【已解决】 git本地不能push到github上
2018-03-10 19:58
330 查看
Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
以上为报错信息
根本 原因是分支冲突导致的
看了这篇文章有所启迪
https://www.cnblogs.com/daemon369/p/3204646.htmlhttp://
第一步
先将你的本地仓库和远程仓库连接起来
建立了一个origin远程仓库
git remote add origin git@github.com:[yourname]/xxx.git第二步
将你 的网络上的文件更新到本地,一定要有READEME.md文件
git pull
第三步
建立一个新的分支abc
git branch abc第四步
更新即可git push -u origin abc
第五步 在项目界面查看新的pull即可,然后选择是否合并到master上
这几步的前提是你修改好了并提交了文件,这些操作应该是在你的新建分支abc下完成的git add xxx.md
git commit xxx.md
查看分支git branch
带*号的就是你当前的分支
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
以上为报错信息
根本 原因是分支冲突导致的
看了这篇文章有所启迪
https://www.cnblogs.com/daemon369/p/3204646.htmlhttp://
第一步
先将你的本地仓库和远程仓库连接起来
建立了一个origin远程仓库
git remote add origin git@github.com:[yourname]/xxx.git第二步
将你 的网络上的文件更新到本地,一定要有READEME.md文件
git pull
第三步
建立一个新的分支abc
git branch abc第四步
更新即可git push -u origin abc
第五步 在项目界面查看新的pull即可,然后选择是否合并到master上
这几步的前提是你修改好了并提交了文件,这些操作应该是在你的新建分支abc下完成的git add xxx.md
git commit xxx.md
查看分支git branch
带*号的就是你当前的分支
相关文章推荐
- Git本地仓库push至GitHub远程仓库每次输入账户密码问题解决
- 解决本地项目上传到github时$git push -u origin master error failed to push some refs...等错误
- 解决本地项目上传到github时$git push -u origin master error failed to push some refs...等错误
- 把本地文件上传到远程仓库:git和github,前提是上传的不能是空文件夹
- 2013.10.20]Eclipse配置Git全过程-----------附用EGit不能push的问题解决
- 解决git error: failed to push some refs to 'git@github.com:
- 使用Git命令push本地项目至github服务器中
- github如何解决failed to push some refs to git
- [Github] fatal: remote error: You can't push to git 解决办法
- Git远端仓库被不同版本的本地仓库push,不能正常提交代码
- 将本地的git仓库push到github上面备份项目
- 【Github】fatal: remote error: You can't push to git 解决办法
- git 本地项目push到GITHUB
- push本地代码到github发生错误的解决办法
- git、github push文件过大异常git-fatal the remote end hung up unexpectedly 解决方法
- GitHub学习-----如何解决 error: failed to push some refs to git
- Git rebase、pull、push 出现 conflict 后不能merge的解决方法
- 〖Linux〗git push orgin master不能解析域名的解决方法
- git - error: failed to push some refs to 'https://github.com/xuzhezhaozhao/Practice.git' 解决办法
- git 将本地代码push到github