Last active
November 15, 2015 16:45
-
-
Save jeetsukumaran/da3e03578fd2744a35d4 to your computer and use it in GitHub Desktop.
Git: show tips of local, remote, or all branches
This file contains 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
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