Last active
August 29, 2015 14:03
-
-
Save sshadmand/b6092a870bc5cd452181 to your computer and use it in GitHub Desktop.
Advanced Git Cheatsheet
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
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d |
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
git remote prune origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First run prune to delink all local branches without a remote branch. Then the second command will remove local branches wthout remote link.