Created
January 14, 2025 12:19
-
-
Save mtib/6699e0d27fd0a40db9fa7ceca25eaadc to your computer and use it in GitHub Desktop.
git branch list
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
| # stolen from https://stackoverflow.com/a/2514279 | |
| function git-branches() { | |
| for k in $(git branch | sed s/^..//); do echo -e $(git log --color=always -1 --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k --)\\t"$k";done | sort | |
| } | |
| function git-remote-branches() { | |
| for k in $(git branch -r | perl -pe 's/^..(.*?)( ->.*)?$/\1/'); do echo -e $(git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k -- | head -n 1)\\t$k; done | sort | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment