[Bro-Dev] git and bash-completions

Seth Hall seth at icir.org
Wed Oct 13 12:08:46 PDT 2010


I don't know if anyone else uses the bash-completions script, but if you do it appears that there is git support available for it.  It makes things much, much easier.  Long topic branch names especially become much easier to work with because you can just tab-complete them.

Here's a site I came across where a guy was talking about using bash-completions with git.
   http://www.simplicidade.org/notes/archives/2008/02/git_bash_comple.html

For anyone that uses a Mac and *really* doesn't want to go to any effort...

=======
sudo port install bash-completion

echo "if [ -f /opt/local/etc/bash_completion ]; then
    . /opt/local/etc/bash_completion
    . ~/.git-completion.sh
    export PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
fi" >> ~/.profile

curl http://repo.or.cz/w/git.git/blob_plain/HEAD:/contrib/completion/git-completion.bash > ~/.git-completion.sh
=======

If you add the PS1 line into your profile, it will show you which branch you currently have checked out whenever you are inside a git repository.  Here's my prompt:

[seth at Blake bro.git (devel)]$

  .Seth



More information about the bro-dev mailing list