I've followed the process for git-completion
as per the description provided at https://medium.com/@farooqyousuf/autocomplete-git-commands-and-branch-names-in-terminal-on-mac-os-x-4e0beac0388a:
The first step is to execute this command in your terminal window, this is basically grabbing the ‘git-completion.bash’ script and putting it in your home directory.
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
Now add this line to your ‘~/.bash_profile’. This will allow the execution of the git autocomplete script if it present
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
You can now restart all your terminal windows or just refresh the terminal window you wish to use this script in. To refresh do:
source ~/.bash_profile
Following is the error I'm getting while hitting tab
key after typing git
:
unknown 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>]
git version 2.17.1