Git and .profile – Aliases and config

Many thanks to Tim for his article Installing git on Mac OS X 10.5 Leopard. It’s a great starting point for git use on OS X Leopard.

In addition to his configuration and aliases, I have a couple of my own that I have added. Here’s an excerpt from my .profile:

git config --global user.name "Your Name"
git config --global user.email "your email"
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.co checkout
git config --global alias.br branch
git config --global merge.tool opendiff
git config --global merge.summary true
git config --global core.excludesfile ~/.gitignore

alias g='git'
alias gst='g st'
alias gci='g ci'
alias gdiff='g diff'
alias gadd='g add'

I don’t have anything against the space bar, but it does seem to be easier with those aliases. See Tim’s article for some additional comments on some of the git configuration.

The color configuration commands will also add quite a bit of richness to your git experience.

This entry was posted on Thursday, June 5th, 2008 at 11:32 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

2 Responses to “Git and .profile – Aliases and config”

  1. vmann says:

    I’m curious as to why not just make ~/.gitconfig vs. putting calls to ‘git config’ in .profile?

  2. kanske says:

    I didn’t put them in .gitconfig simply because I didn’t know about .gitconfig when I set up Git :) Good question though. I sort of like them in my .profile because they are right next to my git shell aliases. So, no good reason at all.

Leave a Reply