merge vs rebase debate - mmedrano9438/peripheral-brain GitHub Wiki

  • Merge is best used when the target branch is supposed to be shared. Rebase is best used when the target branch is private. Merge preserves history. Rebase rewrites history
  • The merge command will let us take all of the development changes present on the master branch and integrate them into the Feature 2 branch with a single merge commit.
  • We can use the rebase command to integrate changes from the master branch into our Feature 2 branch by rewriting the commit history in order to produce a straight, linear succession of commits. Rebasing moves the entire Feature 2 branch to begin on the tip of the master branch.

When I need to update a feature branch I am working on with master I will ALWAYS rebase. I choose to do this because I like my branch history clean. If all the commits are new code it is easier for me to read and follow. merging when incorporating a feature branch into a master branch is the most common practice when you are working on a repo with a team. How you choose to handle updating your personal feature branches is usually left up to you....