views:

27

answers:

1

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?

+2  A: 

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?

kwatford
kwatford is right. you end up with conflicts because your changes are based on outdated versions of the files. when git tries to apply your changes, it sees that your changes are trying to change code that isn't the same as what you started with, so it sets it as a conflict
Derick Bailey