Github无法提交代码如何解决?

4,169 阅读1分钟

git提交时候报错:The file will have its original line endings in your working directory.

错误描述

错误描述 在使用git提交的时候出现The file will have its original line endings in your working directory.错误,后来发现 自己再提交的时候忘记输入git add 上传的文件 出现了上面的错误,需要下面进行修改:

1 git rm -r -f --cached ./ (删除缓存)

2 git add . (添加该目录下所有文件)

3 git push -u origin master (这时候提交就没问题了)

初次提交的命令

git init

git add README.md

git commit -m "first commit"

git remote add origin git@github.com:xxxx.git

git push -u origin master

Github提交出现Branch master set up to track remote branch master from origin问题,未能成功提交代码,请问此问题如何解决?

添加到本地仓库

git add .

添加提交描述

git commit -m '内容'

提交前先从远程仓库主分支中拉取请求

git pull origin master

把本地仓库代码提交

git push -u origin master

如果先报错:The file will have its original line endings in your working directory.再报错Branch master set up to track remote branch master from origin

1、删除缓存
git rm -r -f --cached ./ 

2、添加到本地仓库
git add .

3、添加提交描述
git commit -m '内容'

4、提交前先从远程仓库主分支中拉取请求
git pull origin master

5、把本地仓库代码提交
git push -u origin master