A git alias to show a detailed git branch overview
- Published at
- Updated at
- Reading time
I came across Carolyn Van Slyck's article git wip: What the heck was I just doing?. She shared an excellent git alias (
git wip) that shows all available branches and how long their last commit is ago.
[alias] wip = for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads
I tweaked it a bit to include the commit message of the last commit and changed it to
[alias] zup = for-each-ref --sort='authordate:iso8601' --format='%(color:green)%(authordate:relative)%09%(color:white)%(refname:short) / %(contents:subject)' refs/heads
That's the result. 👇
Love it! Thanks, Carolyn!
- How to list all open GitHub pull requests and select one on the command line
- A terminal script to get notified when macOS changes its appearance (dark/light mode)
- How to build useful, empathic and robust CLI tools
- A trick to run shell examples with a leading $
- How to force yourself to leave the computer using the leave command