我只在项目上工作。我曾在git log
5次提交。我把这些提交合并为一个推送本地git提交历史到原始分支
git rebase -i HEAD~5
pick xxxx commit1
squash xxxx commit2
squash xxxx commit3
squash xxxx commit4
squash xxxx commit5
现在我有一个在git log
提交。一切都很好。但我有git status
之后的下一条消息:
Your branch and 'origin/master' have diverged,
# and have 1 and 5 different commits each, respectively.
我要做git pull
但在那之后我就重写我的git log
5再次承诺(我认为)。
长话短说如何推动本地git将历史提交到原始分支并摆脱分歧错误?
你想压缩已发布的提交吗?然后检查http://stackoverflow.com/questions/8386996/how-can-i-choose-to-overwrite-remote-repository-with-local-commits – Greg