Last active
February 22, 2016 08:13
-
-
Save jethroo/779a591d5da90229c66b to your computer and use it in GitHub Desktop.
deletes all local branches with no changes in 1 week
This file contains 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
for k in $(git branch | sed /\*/d | grep '../..'); do | |
if [ -n "$(git log -1 --since='1 week ago' -s $k)" ]; then | |
echo keeping $k; | |
else | |
git branch -D $k; | |
fi; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment