Hier ist mein Setup:
brew install git bash-completion
Warning: git-2.1.3 already installed
Warning: bash-completion-1.3 already installed
In .bash_profile:
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
Aber ich habe immer noch keine automatische Vervollständigung für Git-Befehle. (Ich habe zuvor Macports verwendet, es aber vollständig entfernt, weil ich keine Git-Befehle zur automatischen Vervollständigung erhalten konnte, egal was ich versuchte.)
Ich habe OSX 10.10
Für Yosemite funktionierte dies nach dem Upgrade auf Git 2.1.3 mit Homebrew in meiner .profile
Datei ( .bash_profile
oder ähnliches würde auch funktionieren):
# git tab completion (homebrew)
if [ -f `brew --prefix`/etc/bash_completion.d/git-completion.bash ]; then
. `brew --prefix`/etc/bash_completion.d/git-completion.bash
fi
Früher hatte ich git-prompt.sh
dort, aber es zu ändern, um git-completion.bash
für mich zu arbeiten. jammv.
Versuchen Sie den Download direkt in Ihrem Home-Verzeichnis:
curl -O https://raw.github.com/git/git/master/contrib/completion/git-completion.bash
mv git-completion.bash .git-completion.bash
Fügen Sie dann .bash_profile
Folgendes hinzu:
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
Auf meinem System (10.10.5) habe ich dies behoben, indem ich in /usr/local/etc/bash_completion.d/ einen Symlink zu bash_completion.d/git-completion.bash im GIT-Verzeichnis erstellt habe. In meinem Fall:
cd /usr/local/etc/bash_completion.d
ln -s ../../Cellar/git/2.7.2/etc/bash_completion.d/git-completion.bash git-completion.bash
Stellen Sie sicher, dass Sie Ihre installierte Version von Git auschecken und 2.7.2 durch Ihre Version ersetzen.
qed
wget https://raw.github.com/git/git/master/contrib/completion/git-completion.bash && source git-completion.bash
, noch kein Glück.Maragues
qed
. ~/.git-completion.bash
direkt in der Shell geht es nicht. Auch keine Fehlermeldung.