Compact and pretty GIT log

Problem

You want to see all your commits of a git repository but the default “git log” output is not very nicely formatted and verbose.

Solution

Use the following command:

git log --author="Your Name" --pretty="%C(yellow)%h%Cred%d%Creset %s%C(white), %C(green)%ar%Creset"

The output will look like this:

gitlog-compact

Of course you could also remove the –author parameter or add the –graph parameter to see some graphical branching info.

You can also write the log to a file easily (without the coloring):

git log --author="Your Name" --pretty="%h %d %s, %ar" > my-commits.txt

Sources

Based on: https://gist.github.com/AvnerCohen/3900286

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.