Skip to content

Instantly share code, notes, and snippets.

@j2deme
Last active December 31, 2021 03:03
Show Gist options
  • Save j2deme/3352975 to your computer and use it in GitHub Desktop.
Save j2deme/3352975 to your computer and use it in GitHub Desktop.
Git Improvements

Colorize Git Output

By default, ANSI color is turned off. You can enable it globally with the following command:

git config --global --add color.ui true

or on a per-repo basis:

git config --add color.ui true

http://coderwall.com/p/2ruxww

Better Log

Use git lg instead! type this:

git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"

or

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

And every time you need to see your log, just type in git lg or, if you want to see the lines that changed git lg -p

http://coderwall.com/p/bl09zg

http://coderwall.com/p/euwpig

Git Summary

To get a clean summary of all the changes of a project do:

git shortlog --no-merges master

or to specify since:

git shortlog --no-merges master --not hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment