Created
January 29, 2015 10:26
-
-
Save garethstockwell/49d13da5333303ad5fc7 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 '* \\033[0;32m%-30s\\033[0m %s\\n' \"$br\" \"$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