When Pulling Rebase or Merge?

When Pulling Rebase or Merge?

In summary, when looking to incorporate changes from one Git branch into another:
  1. Use merge in cases where you want a set of commits to be clearly grouped together in history.
  2. Use rebase when you want to keep a linear commit history.
  3. DON'T use rebase on a public/shared branch.

Does git pull merge or rebase?

By default, the git pull command performs a merge, but you can force it to integrate the remote branch with a rebase by passing it the --rebase option.

Should I pull after rebase?

tl;dr You should update both master and feature with git pull and git pull --rebase before rebasing feature on top of master . There is no need to do a git pull after you have rebased your feature branch on top of master .

Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.