HillLiu / bin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

git unknown option

HillLiu opened this issue · comments

https://apple.stackexchange.com/questions/327817/git-completion-bash-producing-error-on-macos-sierra-10-12-6?rq=1

git Unknown option: --list-cmds=list-mainporcelain,others,nohelpers,alias,list-complete,config

use different version git autocomplete

git218=`git version | awk '{ split($3, a, "."); print (a[1]>2 || a[2]>=18) ? "YES" : "NO"}'`
if [ "$git218" = "YES" ]; then
  if [ -e $HOME/bin/git-completion-2.21.0.bash ]; then 
      source $HOME/bin/git-completion-2.21.0.bash 
  fi
else
  if [ -e $HOME/bin/git-completion.bash ]; then 
      source $HOME/bin/git-completion.bash 
  fi
fi