您的位置:首页 > 编程语言

【已解决】 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
带*号的就是你当前的分支
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: