0 votes
in Git by

What’s the difference between rebase and merge? When should you rebase and when should you merge?

1 Answer

0 votes
by

Both rebase and merge commands are used to integrate changes from one branch to another but in a different manner.

As seen in the below two images, suppose you have commits (this is before merge/rebase). After the merge, you will get the result as a combination of commits. It binds together the histories of both the branches and creates a new ‘merge commit’ in the feature branch.

On the other hand, rebase will move the whole feature branch to begin at the tip of the master branch.

Related questions

+1 vote
asked Apr 4, 2023 in Feature Engineering by john ganales
0 votes
asked Jan 1 in Hibernate by rajeshsharma
...