Skip to content

Instantly share code, notes, and snippets.

@Hamatti
Created January 16, 2014 00:31
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Hamatti/8447583 to your computer and use it in GitHub Desktop.
Save Hamatti/8447583 to your computer and use it in GitHub Desktop.
Added some alias stuff to display git branch description everytime I do git status (or gs as it's aliased for me). That helps me keep on track with branches that are named like issue-[nro] or fix-[nro].
function parse_git_branch_name {
git rev-parse --abbrev-ref HEAD
}
function parse_git_description {
git config branch.$(parse_git_branch_name).description
}
alias gs='echo $(parse_git_branch_name): $(parse_git_description) && git status'
@prmichaelsen
Copy link

Hi! This is very cool. I only just recently using git for more than just linear commits. How would I set up my git to run this script?

Update: I've got the script running! Thanks for writing this!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment