1

When doing a git pull I got the following error:

enter image description here

The error text is: "line 0: syntax error near unexpected token '('

I have done a git pull on this machine once before successfully.

What is causing this error and how can I fix it?

Tyler Durden
  • 10,296
  • 8
  • 53
  • 109

1 Answers1

1

Check the output of git config --show-origin -l: there might be an editor registered with the wrong syntax (for instance, without the proper quotes or escape characters), which are causing the path in a git configuration to be problematic.

Edit the right config (system, global or local) with git config --edit, and remove the incorrect setting.

Check "How can I set up an editor to work with Git on Windows?": since Git (for Windows) 2.5.3+, a simple git config core.editor notepad should be enough.

Or, for notepad++:

git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • This turned out to be the problem, an unquoted path to the exe. The line in the .gitconfig should read: editor = "'C:\\Program Files (x86)\\Notepad++\\notepad++.exe'" – Tyler Durden Dec 15 '16 at 21:38