Why does git pull --rebase fail when replaying existing commits?

不想你离开。 提交于 2019-12-23 09:47:37

问题


I don't get this: when I 'git pull --rebase remote branch' it reverts my HEAD back to their shared root and then starts replaying all of the remote commits that have happened in the meantime. Why do these commits sometimes fail? They are clean commits on a clean workspace? Isn't that almost the point of rebasing?


回答1:


Are you sure it isn't your commits failing?

Suppose you are working on a branch and make a bunch of changes to a specific file.

Now you want to rebase your commits on to whatever the head of the remote is.

All of your changes are removed, then all of theirs are applied, then all of your changes are re-applied on top of that. So what if they deleted the file you're working on? Or otherwise made changes that make your changes impossible to apply?



来源:https://stackoverflow.com/questions/3145420/why-does-git-pull-rebase-fail-when-replaying-existing-commits

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!