Git Cheat Sheet
January 20th, 2011
No comments
Many of these came from help.github.com. I’ll probably edit this post as I learn more about git.
Several ways I can figure out to see my settings are:
cat .git/config #Project Settings cat ~/.gitconfig #Global Settings git config --list |
Some of my default setups are as follows:
git config --global user.name "Michael Tuttle" git config --global user.email "username@mstuttle.com" git config --global color.ui true git config --global core.filemode false |
Some of the aliases that I use are:
git config --global alias.br branch git config --global alias.ck checkout git config --global alias.cm commit git config --global alias.cmm 'commit -m' git config --global alias.cmam 'commit -am' git config --global alias.st status |
One thing that I was finally able to find on the web was setting the tab widths to 4 instead of 8.
git config --global core.pager 'less -FXRS -x4' |
Update: I just ran into an interesting alias from junkie.net. It creates a nice little git log view for the command line.
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" |