Git aliases

Useful git aliases:

#create “cm” alias for “commit”
git config alias.cm commit

#create “co” alias for checkout
git config alias.co checkout

#make “br” alias for branch
git config alias.br branch

# create alias for diff
git config alias.df diff

# create alias for status
git config alias.st diff

# When you want to see just the differences of one function in one file in two different commits:
git config alias.funcdiff ‘!sh -c “git show \”\$1:\$3\” | sed -n \”/^[^ \t].*\$4(/,/^}/p\” > .tmp1 &&
git show \”\$2:\$3\” | sed -n \”/^[^ \t].*\$4(/,/^}/p\” > .tmp2 &&
git diff –no-index .tmp1 .tmp2″‘ –