Created
June 30, 2016 07:34
-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output example:
