DEV Community


Posted on


git rebase vs git merge

git rebase

it removes the existing commits which are ahead of the current node and it applies a new reference to the parent branch and fast forward the commits as a clean way

git merge

it simply merges from parent to child and child to parent without dereferencing

If you only ever rebase commits that have never left your own computer, you’ll be just fine. If you rebase commits that have been pushed, but that no one else has based commits from, you’ll also be fine. If you rebase commits that have already been pushed publicly, and people may have based work on those commits, then you may be in for some frustrating trouble, and the scorn of your teammates.

Top comments (0)