How to keep git merge graph clean
When you have two branches that have diverged. You're done with your feature branch and you want to make the final merge from your feature branch back into your master branch...
Starting from your feature branch...
git merge develop
git rebase develop
git checkout develop
git merge featureBranch --no-ff
git push
It should now look like this:
Now, to clean up your feature branch from the remote and locally:
git push --delete origin featureBranch
git branch -D featureBranch
Your merge tree now looks like this:
Written by Michael Ibarra
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#