Skip to content

Instantly share code, notes, and snippets.

@cpedro
Created July 19, 2019 21:39
Show Gist options
  • Select an option

  • Save cpedro/edf02c337019040176b619393ab7d7dc to your computer and use it in GitHub Desktop.

Select an option

Save cpedro/edf02c337019040176b619393ab7d7dc to your computer and use it in GitHub Desktop.
Print git refs on a repo in pretty format.
#!/bin/bash
# File: git-refs
printf "\e[1;34m${PWD}\e[0m"
fmt='
%(color:bold cyan)%(refname:short)%(color:reset):
Commit: %(color:yellow)%(objectname)%(color:reset)
Date: %(committerdate:format:%Y-%m-%d %H:%M:%S)
Committer: %(committername) %(committeremail)'
git for-each-ref --sort=-committerdate --format="$fmt" refs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment