Created
December 30, 2013 18:23
-
-
Save mattdeboard/8185743 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# You can run this to make fetch automatically prune any time you pull or | |
# fetch. | |
# | |
# git config remote.origin.prune true | |
git fetch --prune | |
# Abort early if there are local changes | |
git checkout master || exit | |
git pull --ff-only origin master || exit | |
# Remove any local branches that have been merged | |
git branch --merged master | grep -v "\*" | xargs -n 1 git branch -d | |
echo "These remote branches have not been merged into origin/master" | |
git branch -r --no-merge origin/master | |
echo "These local branches have not been merged into origin/master" | |
git branch --no-merge origin/master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment