bobthecow / git-flow-completion

Bash, Zsh and fish completion support for git-flow.
MIT License
2.79k stars 385 forks source link

Mac OS High Sierra issue: was missing right version of git-completion.bash #55

Open FelixGV opened 5 years ago

FelixGV commented 5 years ago

I was following the helpful instructions provided here:

https://github.com/bobthecow/git-flow-completion/issues/46#issuecomment-332724240

However, afterwards, I got the following appearing in my shell:

git flowUnknown option: --list-cmds=list-mainporcelain,others,nohelpers,alias,list-complete,config
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

I then discovered on StackExchange that it was because the master version of git-completion.bash I had downloaded was too recent for my built-in version of git:

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

Solution

I found out what my version of git was:

$ git --version
git version 2.10.1 (Apple Git-78)

And then I downloaded the corresponding git-completion.bash version, e.g.:

https://raw.githubusercontent.com/git/git/v2.10.1/contrib/completion/git-completion.bash

It works for me now (:

cashank commented 5 years ago

Upgrading git via Brew will also fix this (brew install git; launch new terminal session), if you're allowed to do this on your machine. Literally just resolved this same issue on Mojave.

bobthecow commented 5 years ago

@FelixGV want to add a note to the wiki? :)

simonmarton commented 5 years ago

Thanks! I also needed to set the LC_ALL envvar for sed on a fresh Mojave.

eg.

# .bash_profile

LC_ALL=C
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion