3

When I type the git commit command to commit my file, I get this error message:

Microsoft Visual Studio: Microsoft: command not found

error: there was a problem with the core editor 'Microsoft Visual Studio'.

Please supply the message using either -m or -F option.

Community
  • 1
  • 1
A. Lyoussi
  • 115
  • 1
  • 2
  • 6
  • 1
    You should use `git commit` with the `-m ` option. because a git commit always need a explain message. For example: `git commit -m "add the search feature"` – Casimir Crystal Sep 13 '15 at 08:02
  • 1
    possible duplicate of [How can I set up an editor to work with Git on Windows?](http://stackoverflow.com/questions/10564/how-can-i-set-up-an-editor-to-work-with-git-on-windows) – joran Sep 13 '15 at 08:54
  • possible duplicate of [How do I make git use the editor of my choice for commits?](http://stackoverflow.com/questions/2596805/how-do-i-make-git-use-the-editor-of-my-choice-for-commits) – random Sep 13 '15 at 13:44

1 Answers1

2

Check you git config core.editor value.
It might refer to a path with spaces in it, without quotes.

Make sure to use simple quotes when registering that editor path:
(And double quotes around the all command expression registered.
And '/' instead of '\' for the path separator)

git config core.editor "'C:/path/with spaces/xxx.exe' -<someoptions>"

That what was done when using, for instance, Visual Studio Code as a git editor.

Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • 1
    Suddenly started being a problem and this command fixed it, even though I'm using /usr/bin/vim – Ghoti Nov 06 '17 at 21:48