Skip to content

Instantly share code, notes, and snippets.

@garethstockwell
Created January 29, 2015 10:32
Show Gist options
  • Save garethstockwell/1421ebb0f140e8ea56b0 to your computer and use it in GitHub Desktop.
Save garethstockwell/1421ebb0f140e8ea56b0 to your computer and use it in GitHub Desktop.
git alias for showing branch descriptions
# 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