Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have ML with Xcode installed tools (git coming from there).

Later I've installed brew and install bash-completion, but git commands still not auto-completed.

Brew has no such package. Google does not helped. How I can enable git completion support in Mountain Lion?

share|improve this question
    
Answers containing just links will automatically be converted to comments. The way it's now is fine. Cheers! – slhck Sep 18 '12 at 9:50
    
questions like these really belong on ask different, the apple stack exchange site, at apple.stackexchange.com – JamiePatt Sep 18 '12 at 11:08

SOLVED:

I've found solution here: http://apple.stackexchange.com/questions/55875/how-can-i-get-git-to-autocomplete-e-g-branches-at-the-command-line and it works well.

I got that by using curl from the URL here:

curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash

Then I added to my ~/.bash_profile file the following "execute if it exists" code:

if [ -f ~/.git-completion.bash ]; then . ~/.git-completion.bash; fi

share|improve this answer
    
+1 - Don't reply to this comment, I will delete it but that is a good answer! – Dave Sep 18 '12 at 9:41
2  
That should be -o ~/.git-completion.bash instead of -o /.git-completion.bash – obvio171 Nov 16 '12 at 16:46
    
Also, there needs to be a ; before the fi – SooDesuNe Mar 14 '13 at 20:23
    
I would suggest changing the URL to https://raw.githubusercontent.com/git/git/v1.8.5.2/contrib/completion/git-compl‌​etion.bash in order to grab the completion script matching ML's Git version (1.8.5.2). – Slipp D. Thompson Jul 29 '14 at 2:00
    
Strangely, a Zero Width Non-Joiner character (U+200C) got inserted in the middle of the URL in my last comment. Try the URL of this link instead: github/git/git/v1.8.5.2/contrib/completion/git-completion.bash. – Slipp D. Thompson Jul 29 '14 at 2:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .