Published at
Updated at
Reading time
1min

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.

output of "git wip" command showing available branches with time to the last commit

[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 zup, too.

[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. 👇

Output of `git zup` command showing available branches, the time ago and the last commit message

Love it! Thanks, Carolyn!

Was this snippet helpful?
Yes? Cool! You might want to check out Web Weekly for more snippets. The last edition went out 19 days ago.
Stefan standing in the park in front of a green background

About Stefan Judis

Frontend nerd with over ten years of experience, freelance dev, "Today I Learned" blogger, conference speaker, and Open Source maintainer.

Related Topics

Related Articles