Git Tricks

Some git aliases I like to have handy

# Make "com" alias for "commit"
git config --global alias.com commit
# Make "co" alias for checkout
git config --global alias.co checkout
# Make "br" alias for branch
git config --global alias.br branch
# What did I commit today
git config --global alias.today "log --since=midnight --author='$(git config user.name)' --oneline"
# What did I commit yesterday
git config --global alias.yesterday "log --graph --all --since=day.before.yesterday.midnight --until=midnight --author=\"$(git config user.name)\" --oneline"
# A better log view
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"