Posts Tagged ‘git’

Git Cheat Sheet

January 20th, 2011 No comments

Many of these came from 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 "Michael Tuttle"
git config --global ""
git config --global color.ui true
git config --global core.filemode false

Some of the aliases that I use are:

git config --global alias.amend 'commit --amend'
git config --global branch
git config --global checkout
git config --global commit
git config --global alias.cmm 'commit -m'
git config --global alias.cmam 'commit -am'
git config --global 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 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"
git config --global "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all"
git config --global.alias.l "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative -10"
Categories: Software Tags: