2010年8月14日 星期六

Git autocomplete in Mac OS X

I always liked that my Git installations on Unix and Linux comes with the contrib/complete/git-completion.bash script activated or easily activated. But its harder if you use the pre-built binaries for Mac OS X.

To get autocompletion to work on Mac OS X when installing the pre-built binaries do this.
UPDATE: Instead of step 1 and 2 below you can get the completion script directly from Github. Thanks to Fredric.

curl http://github.com/git/git/raw/master/contrib/completion/git-completion.bash -O

1. Download the Git source from git-scm.com.
2. Unpack and copy the completion script git-completion.bash found in contrib/completion to your home directory.

3. Add the following to your ~/.profile or ~/.bash_profile

source ~/git-completion.bash

alias gco='git co'
alias gci='git ci'
alias grb='git rb'
4. Add the following to your ~/.gitconfig

[alias]
co = checkout
ci = commit
rb = rebase

摘自:http://www.codethatmatters.com/2010/01/git-autocomplete-in-mac-os-x/

沒有留言:

wibiya widget