Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Autocompletion: syntax error near unexpected token `newline'

Tags:

git

bash

git-bash

I have looked at different questions regarding this issue and none seem identical to mine: new git installation on Mac 10.10.2

I have used the below to install auto-completion:

curl -OL https://github.com/git/git/blob/master/contrib/completion/git-completion.bash

I have also tried the above with: -O.

I have added a . to the file that was downloaded:

mv ~/git-completion.bash ~/.git-completion.bash

Then I edit my bash_profile and inserted the line to get an auto load when terminal loads:

if [ -f ~/.git-completion.bash ]; then
  source ~/.git-completion.bash
fi

Up on restarting terminal:

Users/user/.git-completion.bash: line 4: syntax error near unexpected token `newline'

Is there an issue with the file that was download or my OS?

like image 837
Sylar Avatar asked Feb 26 '15 18:02

Sylar


1 Answers

curl -OL https://github.com/git/git/blob/master/contrib/completion/git-completion.bash

this is not real '.bash' file. (looks like website html file)

if you want to git-completion.bash file,

connect site "https://github.com/git/git"

and

click on the "Download ZIP" button

thanks.

like image 198
jay Avatar answered Oct 11 '22 17:10

jay