Download and install
git-osx-installer
Configure
git config --global user.name "user.name"
git config --global user.email "user.email"
git config --global color.ui auto
git config --global pager.status true
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.br branch
git config --global alias.co checkout
git config --global alias.amend 'commit --amend'
git config --global core.excludesfile ~/.gitignore
echo '.DS_Store' >> ~/.gitignore
Basic workflow
# Create a new repo:
git init
git co master
# Pull upstream if necessary:
git pull
# Create a topic_branch
git br topic_branch
# edit/compile/test
# checkpoint to the index:
git add filename
# Revert file to index:
git co -- filename
# Revert file to master:
git co master -- filename
# Merge in any changes made in master while on topic_branch:
git rebase master
git commit
# Merge topic_branch back to master and delete:
git co master
git merge topic_branch
git branch -d topic_branch
Useful references
Git home
git ready - daily tips for the noob to the guru
git-fu