HomeBrew的安裝
打開終端,執(zhí)行以下命令:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
地址可能會有變化永毅,請移步官網(wǎng)查詢最新的安裝方法
關(guān)于brew的使用可參看:http://blog.csdn.net/dracotianlong/article/details/9136017
安裝git-completion
命令: brew install git-completion
卸載:brew uninstall <要卸載的插件>
安裝過程中會提示你把下面這段配置拷貝到你的 .bash_profile 中:
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
沒有 .bash_profile就自己見一個咯:
vim ~/.bash_profile
完成拷貝后,保存退出,執(zhí)行:
source ~/.bash_profile
下載git源碼
如果沒有事先安置git,則可以使用brew安裝:
brew install git
clone git 源碼
git clone https://github.com/git/git.git
找到"contrib/completion/"目錄下的git-completion.bash针炉,將該文件拷貝到~/下并重命名為.git-completion.bash
source .it-completion.bash