Rebasing
All these extra merge commits you can get from merging and cherry picking make a mess of your commit history. They are all superfluous commits that only exist because you need to merge some changes. Instead of merging, you can rebase your branches. When you rebase a branch, you are basically saying your branch was not branched from commit A, but from commit B. So, imagine you are working on a feature branch, but you do want to keep up with the master branch so your branch is not left behind on features. Besides, if you do not pull regularly, the chances of conflicts increase and it is easier to solve them as they come. Instead of merging or cherry picking everything your coworkers do, you can simply rebase your branch:
git checkout ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access