There is a similar question to this one but its scope is too general and the response overly complicated. My question is very punctual
When from my branch MyBranch
and doing a rebase like git rebase master
and having a conflict
which is incoming change? and which is current change?
Please don't close this question linking it to previously said overly general and overly complicated answer that covers rebases, merges, etc. This question is ONLY about rebase
CodePudding user response:
When from my branch
MyBranch
and doing a rebase likegit rebase master
and having a conflict which is incoming change? and which is current change?
When rebasing MyBranch
onto master
, "incoming" is the branch you have checked out, which is MyBranch
, and "current" is master
.
The reason is because of what rebase actually does behind the scenes. Rebase first resets your branch to master
, and then replays each of the commits from MyBranch
onto master
. If there is a conflict while doing that rebase, then at that moment, master
is now your temporary "current" and MyBranch
is "incoming" because you're replaying those commits. Once the rebase completes you'll have MyBranch
checked out again and back to where it would be considered "current" again.
The reason the explanation is oftentimes included with merging, is because the labels are flipped, and are perhaps more intuitive, for merge
. "Incoming" is the branch you're merging in, and "current" is your branch.