Home > front end >  Git Merge Fast-Forward vs Git Rebase
Git Merge Fast-Forward vs Git Rebase

Time:01-12

What is the difference between a fast-forwarded git merge and a git rebase? Don't both accomplish keeping history linear and no merge commits? If so, why would one use one over the other? If not, which is what I think is true, what is the whole story that I'm not seeing?

Thanks!

CodePudding user response:

When you are ahead of master, both do the same thing.

If you're ahead and behind master, then a fast-forward merge isn't possible, since there are newer commits on master. But in that case, you can rebase, creating new commits based on the commits that are ahead of master.

  •  Tags:  
  • Related