Skip to content

Instantly share code, notes, and snippets.

@jeetsukumaran
Last active November 15, 2015 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeetsukumaran/da3e03578fd2744a35d4 to your computer and use it in GitHub Desktop.
Save jeetsukumaran/da3e03578fd2744a35d4 to your computer and use it in GitHub Desktop.
Git: show tips of local, remote, or all branches
Add the following to the [alias] section of your ``~/.gitconfig`` to give your self ``git tips``, ``git rtips``, and ``git atips`` commands.
# show tips of every branch; modified from: https://gist.github.com/jasonrudolph/1810768#gistcomment-1391494
tips = !"for k in `git branch | perl -pe 's/^..(.*?)( ->.*)?$/\\1/'`; do echo \"$k\\t\" `git show --pretty=format:\"%Creset%C(cyan)[%ai] %C(yellow)%h %Creset%s %C(green)(%an)%Creset\" $k -- | head -n 1`; done | sort -r -k2 | column -ts $'\t'"
rtips = !"for k in `git branch -r | perl -pe 's/^..(.*?)( ->.*)?$/\\1/'`; do echo \"$k\\t\" `git show --pretty=format:\"%Creset%C(cyan)[%ai] %C(yellow)%h %Creset%s %C(green)(%an)%Creset\" $k -- | head -n 1`; done | sort -r -k2 | column -ts $'\t'"
atips = !"for k in `git branch -a | perl -pe 's/^..(.*?)( ->.*)?$/\\1/'`; do echo \"$k\\t\" `git show --pretty=format:\"%Creset%C(cyan)[%ai] %C(yellow)%h %Creset%s %C(green)(%an)%Creset\" $k -- | head -n 1`; done | sort -r -k2 | column -ts $'\t'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment