0

I am working on feature branches and need to take the latest code from the development branch into the feature branch.

Earlier I used to do it via git merge but that creates additional merge commits. So I have started using git rebase from source tree.

My understanding is that merge and rebase should cause similar conflicts. But in actual, when I do a merge , the conflicts shown are normal in the way they should be with the content of feature branch proper.

But in case of a rebase, the conflicts are totally different and some code which is not even in the feature branch is shown up as conflicts. If I resolve conflicts this way, it will actually make my file inconsistent. I have tried this multiple times and every time rebase creates conflicts which are not in line with the actual feature branch. Am I missing something conceptually?

1 Answer 1

1

Merge compares between the last commits only of your development branch and feature branch.

In the other hand, Rebase takes the development branch and tries to re-apply your commits in feature branch one by one. It means it will compare each commit of your feature branch to the last new commit emerging after each Rebase iteration.

Sign up to request clarification or add additional context in comments.

2 Comments

... so, typically, if your history is messy with commits that introduce something, and further commits that cancel it, then rebase may show more conflicts (one for the commit that introduces something, one more for the one that deletes it).
yes, it re-creates each commit , though I dont know if it has different auto-merge strategies

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.