Tuesday, April 19, 2011

Useful git commands

Some git commands that I found useful...

To remove all untracked files and dirs (aka "uber clean"):
$ git clean -f -d -X

For more useful/clear git log ouput:
$ git log --oneline --decorate

or  better use the following command:
$ git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative

You can add it as alias in ~/.gitconfig :

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

More @ http://cheat.errtheblog.com/s/git


No comments:

Post a Comment