Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need help loading a git-completion.bash file

I am new to git. Every time I try loading my git-completion.bash I got the following error message

line 1: syntax error near unexpected token `newline'
-bash: git-completion.bash: line 1: `<!DOCTYPE html>'

Does anyone know how to solve this issue?

like image 897
Eldan Shkolnikov Avatar asked Nov 28 '14 16:11

Eldan Shkolnikov


People also ask

What is git autocomplete?

Essentially, you start typing a word, then you hit the tab key and Git then tries to guess based on the context what the rest of the command, the file path, or the branch name ought to be. It can really save you a lot of typing.


1 Answers

You accidentally saved the HTML representation of the file from GitHub (https://github.com/git/git/blob/master/contrib/completion/git-completion.bash) instead of the file itself. You should save the raw file instead - https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash .

like image 131
Mureinik Avatar answered Oct 07 '22 21:10

Mureinik