Skip to content

Instantly share code, notes, and snippets.

@OleksandrKucherenko
Created June 30, 2016 07:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OleksandrKucherenko/142c448d0f7879f35f3cf50dc5f02600 to your computer and use it in GitHub Desktop.
Save OleksandrKucherenko/142c448d0f7879f35f3cf50dc5f02600 to your computer and use it in GitHub Desktop.
Get fancy git log, get last top 10 commits. (By parameter can be defined number of line to print)
#!/bin/bash
if [ -z "$1" ]; then
TOP=10
else
TOP=$1
fi
# display top 10 messages with line numbering
git --no-pager log --pretty=format:"%h%x09%Cblue%cr%Cgreen%x09%an%Creset%x09%s%Cred%d%Creset" -n $TOP --date=short | nl -w2 -s" "
@OleksandrKucherenko
Copy link
Author

Output example:
screen shot 2016-06-30 at 09 35 55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment