0

From what I understand, rebase replays the commits of the current branch on the target branch. If I understand it correctly, than if I rebase my branch on top of another branch any possible conflicts can occur only on files I have changed, but it doesn't, and I get conflicts also on files I did not change in my commits (although they are different between the two branches).

Just to be clearer, assume branch Main and A.

  • I create a new branch from A called "newA".
  • Make a few changes on files A.h and A.cpp.

time goes by and Main branch changes quite a lot, but A.h and A.cpp still exists.

  • Now I want to rebase newA back on top of Main.

I expect that if there are any conflicts they will occur only on A.h and A.cpp, but from what I experience I also get conflicts on other files. What am I missing???

Thanks!!!

TCS
  • 5,790
  • 5
  • 54
  • 86
  • Does newA have only files A.h and A.cpp? If not, I'd say that it's working as expected. –  Jan 09 '16 at 20:59
  • newA changes only these 2 files, so why a rebase would conflict other files?! – TCS Jan 09 '16 at 21:02

1 Answers1

1

Rebase IS just replaying the changes. If you run into conflicts with also other files, then the commit history of Main before the branching point must have changed.

juzzlin
  • 45,029
  • 5
  • 38
  • 50