DEV Community

Cover image for GIT: rebase VS merge (simple)
Kristiyan Velkov
Kristiyan Velkov

Posted on • Updated on

GIT: rebase VS merge (simple)

A short and simple explanation about git rebase vs git merge.

Image description

What Is Git Rebase?

Image description

  • git rebase is a powerful Git command that allows you to incorporate changes from one branch into another. It is often used to update a feature branch with the latest changes from the main branch before merging it back. Essentially, it allows you to replay a series of commits on top of a different commit.

What Is Git Merge?

Image description

  • git merge command is used in Git to integrate changes from one branch into another. It allows you to combine the changes made in one branch with the changes in another branch, resulting in a new commit that represents the merge of both branches.

Differences between merge and rebase?

  • The resulting tree structure of the history (generally only noticeable when looking at a commit graph) is different (one will have branches, the other won't).

  • Merge will generally create an extra commit.

  • Merge and rebase will handle conflicts differently. Rebase will present conflicts one commit at a time where merge will present them all at once.

Image description


Image description


Usefull Links


Image description

linkedin


Image description

If you like my work and want to support me to work hard, please donate via:

Revolut website payment or use the QR code above.

Thanks a bunch for supporting me! It means a LOT 😍

Top comments (0)