Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added instructions for new git autocomplete enhancement
  • Loading branch information
carbonbasednerd committed Aug 3, 2012
1 parent 004931c commit 66da6a7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Expand Up @@ -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
---------------------------

Expand Down

0 comments on commit 66da6a7

Please sign in to comment.