Skip to content

Instantly share code, notes, and snippets.

@ZeroBugBounce
Last active October 22, 2015 15:57
Show Gist options
  • Save ZeroBugBounce/a50b5ce15adb7e7eb5b6 to your computer and use it in GitHub Desktop.
Save ZeroBugBounce/a50b5ce15adb7e7eb5b6 to your computer and use it in GitHub Desktop.
Various git log techniques
# This shows the git log in a color-coded one line format, excludes merge commits
# and omits (grep -v) commits that mention 'chef'. It also places line numbers
# in front of the commits that are listed, for squashing on HEAD~# purposes.
gitlog() {
(git log -${@-20} --pretty=format:'%C(yellow)%h%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --no-merges | grep -v 'chef') | awk '{printf("%3d %s\n", NR, $0)}'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment