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
  • 11,156
  • 9
  • 64
  • 126

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,262,500
  • 529
  • 4,410
  • 5,250
  • 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