Created
February 7, 2013 12:42
-
-
Save igorescobar/4730665 to your computer and use it in GitHub Desktop.
Show Which Branches are Merged (or not)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When working with feature branches, you can quickly create so many that clutter up the output of git branch --list. Every now and again you want to get rid of the branches that have made it into master. But you probably have a quick pause before you git branch -d <BRANCH>, but with the below commands you can confidently delete them without a second thought. (via Zach Holman) | |
If you want to see which local branches you have that are merged into the branch you are currently on, then all you need is: | |
git branch --merged | |
The reverse is also available. Show which branches haven't been merged into the currently selected branch with: | |
git branch --no-merged | |
Mash this up with a couple easy UNIX tools and you can quickly delete everything that has already been merged: | |
git branch --merged | xargs git branch -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment