Mac中让git自动补齐

  1. 下载官方的补齐脚本:
curl -o ~/.git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
  1. 配置生效,在~/.bash_profile(没有就新建)中添加如下代码,之后重启Shell。
if [ -f ~/.git-completion.bash ]; then
    . ~/.git-completion.bash
fi

source ~/.git-completion.bash

你可能感兴趣的:(Mac中让git自动补齐)