Created
January 29, 2015 10:32
-
-
Save garethstockwell/1421ebb0f140e8ea56b0 to your computer and use it in GitHub Desktop.
git alias for showing branch descriptions
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
# bds = branch description show | |
# From https://gist.github.com/jeenuv/3145db36eb2a27ba022a | |
bds = "!f() { \ | |
head=$(git symbolic-ref --short HEAD); \ | |
git for-each-ref refs/heads --format='%(refname:short)' | \ | |
while read br; do \ | |
desc=$(git config --get branch.$br.description | head -n1); \ | |
if [ \"$head\" = \"$br\" ]; then \ | |
printf '* %-30s%-10s %s\\n' \"$(tput setaf 2)$br$(tput setaf 9)\" \"\" \"$desc\"; \ | |
else \ | |
printf ' %-30s %s\\n' \"$br\" \"$desc\"; \ | |
fi; \ | |
done; \ | |
}; f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment