Merging is nice because itâs a non-destructive operation. The existing branches are not changed in any way. This avoids all of the potential pitfalls of rebasing .
As an alternative to merging, you can rebase the feature branch onto master branch using the following commands:
git checkout feature
git rebase master
This moves the entire feature branch to begin on the tip of the master branch, effectively incorporating all of the new commits in master. [/url]