User Tools

Site Tools


mac:git

Table of Contents

Git

Installation

brew install git # Originally installed from http://code.google.com/p/git-osx-installer/.
# MAYBE: git-extras git-flow git-hg git-multipush git-sh git-ssh git-subtree git-utils
brew install tig

Configuration

# you
FULL_NAME=$(dscl . -read $HOME RealName | tail -1 | perl -pe 'chop')
git config --global user.name "$FULL_NAME"
git config --global user.email "craig@boochtek.com"
 
# colors
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
git config --global color.interactive auto
 
# shortcuts
git config --global alias.st status
git config --global alias.di diff
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.co checkout
git config --global alias.com commit
 
# if you ever have conflicts you can type git-mergetool
# to use Apple opendiff (FileMerge) for resolving conflicts
git config --global merge.tool opendiff
# Whenever we merge provide a summary of commits
git config --global merge.summary true
 
# globally ignore some cruft files
git config --global core.excludesfile ~/.gitignore
echo "*~" >>~/.gitignore
echo ".DS_Store" >>~/.gitignore
 
# Add bash completion for git command.
ln -s /usr/local/git/contrib/completion/git-completion.bash /Users/booch/bin/bash_completion.d/git
 
# TODO: bash prompt.
export PS1='$(git branch &>/dev/null; if [ $? -eq 0 ]; then \
echo "\[\033[00m\]$(git branch | grep ^*|sed s/\*\ //) "; fi)\$\[\033[00m\] '
mac/git.txt · Last modified: 2013/10/26 13:51 by Craig Buchek