Created
June 29, 2012 10:51
-
-
Save aminin/3017311 to your computer and use it in GitHub Desktop.
Убийца слитых веток
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
#!/bin/bash | |
# Чистит локальные слитые ветки | |
for i in `git branch | grep "^[^*]\+"`; do git branch -d $i; done; | |
# Чистит слитые ветки в удалённом репозитории | |
git log --pretty=format:%H HEAD~1 > /tmp/git-history.txt | |
for i in `git br -r | grep -o "[^ \/]\+$" | sort | uniq`; | |
do | |
H=`git log -1 --pretty=format:%H origin/$i`; | |
e=`grep "$H" /tmp/git-history.txt`; | |
if [ -n "$e" ]; | |
then | |
echo "git push origin :$i"; | |
fi; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment