Created
June 9, 2014 09:00
-
-
Save vilmosioo/f8e36e6236327263bfd2 to your computer and use it in GitHub Desktop.
List of commits to handle local and remote branches
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
// create local branches that target remote branches | |
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do | |
git branch --track ${branch#remotes/origin/} $branch | |
done | |
// delete all remote branches that have been merged to master | |
git branch --merged master | grep -v master | xargs -n 1 git push --delete origin | |
// delete all local branches that have been merged to master | |
git branch --merged master | grep -v master | xargs git branch -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment