Get Mystery Box with random crypto!

Git: Merging vs Rebasing In git, when there are some changes | Web design & 😃 development

Git: Merging vs Rebasing

In git, when there are some changes in a parent branch from which you forked, there are two strategies to incorporate them into your working branch:

Merging:

As the name suggests, 'merges' the parent branch into your branch. The advantage is that handling conflicts (if any) is easier, since you only need to resolve them for the merge commit once. However, this may make the git history a bit harder to follow

Rebasing:

Takes all the commits you made in your branch, and applies them on top of the head of the parent branch. As if repositioning the base of the branch.

This helps to create a linear and easy to follow git history, but conflict resolution may be tedious and you need to force push the branch to the origin.