diff --git a/README.md b/README.md index 0921796..87d64d2 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,32 @@ Lets you tab complete your branch names on the command line. * Add "source ~/.git-completion.sh" to your .bash_profile file * From the command line execute: "source ~/.bash_profile" +git enhanced branch completion +-------------------------------- + +Does the whole autocomplete thing and formats your terminal command line to include the current repo and branch you are working on. +Note that this is set up to work as is for OS X only. + +* +* verify this file exists, /usr/local/git/contrib/completion/git-completion.bash . The file should be installed with GIT utilities on OS X. +* copy the code below into your .profile file. + + # Set git autocompletion and PS1 integration + if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then + . /usr/local/git/contrib/completion/git-completion.bash + fi + + GIT_PS1_SHOWDIRTYSTATE=true + + if [ -f /opt/local/etc/bash_completion ]; then + . /opt/local/etc/bash_completion + fi + PS1='\[\033[32m\]\u@\h\[\033[00m\]:\[\033[34m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ ' + +It should take effect for every new terminal window you open going forward. + +For more information: http://en.newinstance.it/2010/05/23/git-autocompletion-and-enhanced-bash-prompt/ + branch name in prompt ---------------------------