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

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

错误描述git

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

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问题,未能成功提交代码,请问此问题如何解决?

添加到本地仓库bash

git add .
复制代码

添加提交描述spa

git commit -m '内容'
复制代码

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

git pull origin master
复制代码

把本地仓库代码提交rem

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

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

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

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

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

五、把本地仓库代码提交
git push -u origin master
复制代码
相关文章
相关标签/搜索