git-flow-completion
git-flow-completion copied to clipboard
Mac OS High Sierra issue: was missing right version of git-completion.bash
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 (:
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.
@FelixGV want to add a note to the wiki? :)
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