Skip to content

Instantly share code, notes, and snippets.

Last active December 31, 2015 19:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
A few useful log aliases for Git.

This is a list of Git aliases that are really handy for me.


This alias logdate will list entries, one per line.

git config --global alias.logdate "log --pretty=format:'%h %cd [%an] %s' --graph --date=short"

By itself, it will list all commits for the repository. So you usually want to add a limiting parameter. So see only the last five entries:

git logdate -5


This alias logweek will list all commits from the past week.

git config --global alias.logweek "log --pretty=format:'%h %cd [%an] %s' --graph --date=short --since=1.week"

This one does not need to be augmented often. One case is displaying the commit history for the current directory.

git logweek .
* 92f86cd 2015-12-04 [Paul Glezen] Initial commit.


For those really busy days, the logday alias shows all the commits in the last 24 hours.

git config --global alias.logday "log --pretty=format:'%h %cd [%an] %s' --graph --date=relative"

Since the usual date format is superfluous, it provides more detail on the time.

git logday
* 92f86cd 5 hours ago [Paul Glezen] Initial commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment