Added git auto complete for git commands ,keywords and branch-names. #18

Closed
wants to merge 1 commit into
from

Projects

None yet

6 participants

@nodemaker

For example if you type "git ch" and then press tab you will get three choices
checkout cherry cherry-pick

if you type "git checkout" and then press tab you will get
FETCH_HEAD HEAD ORIG_HEAD master origin/HEAD origin/master

(In this case I had only branch master)

@ProLoser
Contributor
ProLoser commented Aug 1, 2012

+1

@richo
Contributor
richo commented Aug 1, 2012

This is pretty amazingly targeted, is it really general enough to warrant going into this project?

@renstrom
renstrom commented Aug 8, 2012

Why not just use bash-completion (installed via Homebrew) instead of sourcing git-completion? Installing Git via Homebrew actually already installs git-completion.bash for use in bash-completion.

@mathiasbynens
Owner

@renstrom Interesting! This would boil down to adding a conditional source $(brew --prefix)/etc/bash_completion to .bash_profile.

@renstrom
renstrom commented Aug 8, 2012

Correct!

Might want to consider a conditional though since most non-osx systems install bash-completion to /usr/share/bash-completion/bash_completion.

@hkdobrev
Contributor
hkdobrev commented Aug 5, 2013

I think this is pretty useful. Actually full-time usage of git from command line is quite hard without it.

When I installed git via brew it added the completion file to /usr/local/etc/bash_completion.d.

The 'contrib' directory has been installed to:
/usr/local/share/git-core/contrib

Bash completion has been installed to:
/usr/local/etc/bash_completion.d

zsh completion has been installed to:
/usr/local/share/zsh/site-functions

I think /usr/share is used by default from the make installer. But since git is installed via .brew in these dotfiles it would be better to use the location which brew uses.

@bennewton999 bennewton999 pushed a commit to bennewton999/dotfiles that referenced this pull request Jan 13, 2014
@sapid @cowboy sapid + cowboy Fixed minor typo. Closes gh-18. da5a78e
@mathiasbynens
Owner

This is now fixed. Thanks for the suggestion + discussion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment