Set up git 1.8 with git completion and customized prompt

Categories Web Tech

And colorize the text in terminal at the same time


Mac instructions:


defaults write AppleShowAllFiles YES

in Terminal first so that hidden files can be seen in Finder.  Changing Yes to No will turn them off again.

Get git-completion.bash and from git and install them in your user directory


or, easier,

curl -o /.git-completion.bash


copy the code and save it into ~/


Edit .bash_profile

Create it in ~/ if it’s not there already

if [ -f ~/.git-completion.bash ]; then
 source ~/.git-completion.bash
if [ -f ~/ ]; then
 source ~/
export PS1='\u: \W$(__git_ps1 "(%s)") > '




Set up with color coded text


name = xxxxxxx
email =
user = xxxxxxx
branch = auto
diff = auto
status = auto

[color “branch”]
current = yellow reverse
local = yellow
remote = green

[color “diff”]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold

[color “status”]
added = yellow
changed = green
untracked = cyan

Leave a Reply

Your email address will not be published. Required fields are marked *