He aquí mi arreglo:
brew install git bash-completion
Warning: git-2.1.3 already installed
Warning: bash-completion-1.3 already installed
En .bash_perfil:
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
Pero todavía no tengo el autocompletado para los comandos de git. (Usé macports antes, pero lo eliminé por completo porque no podía hacer que los comandos de git se autocompletaran sin importar lo que intentara).
Estoy en OSX 10.10
Para Yosemite, después de actualizar a git 2.1.3 con homebrew, esto funcionó en mi .profile
archivo ( .bash_profile
o similar también funcionaría):
# 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
Solía tener git-prompt.sh
allí, pero cambiarlo a git-completion.bash
funcionó para mí. mmmv.
Intente descargar directamente en su directorio de inicio:
curl -O https://raw.github.com/git/git/master/contrib/completion/git-completion.bash
mv git-completion.bash .git-completion.bash
Luego en tu .bash_profile
agrega lo siguiente:
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
En mi sistema (10.10.5), arreglé esto creando un enlace simbólico en /usr/local/etc/bash_completion.d/ a bash_completion.d/git-completion.bash en el directorio GIT. En mi caso:
cd /usr/local/etc/bash_completion.d
ln -s ../../Cellar/git/2.7.2/etc/bash_completion.d/git-completion.bash git-completion.bash
asegúrese de verificar su versión instalada de git y reemplace 2.7.2 con su versión.
qed
wget https://raw.github.com/git/git/master/contrib/completion/git-completion.bash && source git-completion.bash
, sin suerte todavía.Maragües
qed
. ~/.git-completion.bash
directamente en el caparazón no funciona. Tampoco hay mensaje de error.