第一次从本地提交到github提交成功,第二次在目录中添加一些信息在提交却提交不上了,这是什么原因?
git pull 之后提示:
因为你have 1 and 1 different commits each
, 先git pull -r
再git push origin master
, 仔细看hint, hint: because the tip of your current branch is behind its remote counterpart... git pull...)
.
给你安利一个脚本: https://github.com/acrazing/s...
执行git_push.sh "MESSAGE"
自动提交当前的change, 并且自动PULL, 推到origin
远端, 当前分支, 如果没有的话自动创建master
分支. 总之就是帮你自动化了所有的操作.
5 回答2.8k 阅读
3 回答2.6k 阅读
3 回答960 阅读
本地分支与远端有差异,有可能远端分支有本地没有的 commit ,或者本地分支没有与远端分支同源
第一种方法:
如果有冲突,处理冲突之后提交新的 commit ,
git push origin master
第二种方法:
如果有冲突的话,处理冲突之后重新将冲突文件加入 stage,
git rebase --continue
, 一般 rebase 之后因为 commit tree 有变化,所以需要git push -f origin master
进行 push