Want to add some color to your Git log? Check out this git log configuration that gives you one commit per line, a commit graph, abbreviated commit ID’s, relative dates, & commit author all bundled up in color coordinated text.
Git Logs with Graphs and Color
Navigate to your git initialized directory (that includes previous commits) and use this command:
and your output will look like this:
Conserve ATP, Make a Git Alias
Save yourself keystrokes by creating a git alias so that you can open your colorful new log style as if you were using any built-in git command.
Filipe and Patryk demonstrate how to configure the git alias “lg” in the thread. For the above command, it looks like this:
Make sure that you keep that
--global switch if you want this included as part of your global git configuration.
To change the alias name, modify the
alias.lg string with the alias that you’d like to use. For example, to call it purtylog you would change it to
Alternatively, you can add your new alias to your
~/.gitconfig file. Open the file in an editor and (if you have not already done so) add an
[alias] section to the file with the following alias definition for lg:
With both methods, you then view your new log style with the following command (using your new alias):