Created
April 11, 2012 17:33
-
-
Save trobrock/2360761 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
function gbd() { | |
if [[ -n $1 ]]; then | |
if [[ -n $2 ]]; then | |
git push $1 :$2 | |
git branch -d $2 | |
else | |
git push origin :$1 | |
git branch -d $1 | |
fi | |
fi | |
} | |
compdef _git gbd=git-branch | |
function git_diff_count() { | |
foreach b (`git branch | grep -v '*' | grep -v 'master'`); echo $b `git cherry -v master $b | wc -l`; end | |
} | |
function git_diff_clean() { | |
foreach b (`git_diff_count | awk '/([a-zA-Z0-9]+) 0/{print $1}'`); gbd trobrock $b; end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment