I keep getting the following error

    1 c:/Program Files (x86)/Git/bin/git.exe … "commit" "--amend"

    *ERROR*: Wrong type argument: stringp, nilerror: There was a problem with the editor '"c:/Users/George/Desktop/Emacs25/bin/emacsclient.exe"'.
    Please supply the message using either -m or -F option.

I found a few people had similar problems several years back, but none give me a way to fix it. I'm on a Windows 10 machine and not really a pro at emacs - so I'm not sure how to resolve this problem.

I've confirmed git is working fine through gitbash.

I also tried deleting all my packages (to make sure there are no weird conflicts) and reinstalled magit from MELPA.

I'm running Emacs 25.1.

  • IIRC "Please supply the message using either -m or -F option." is a Git error message, which means it was called incorrectly (it expects you to supply commit message or a file containing the message). I think --amend is a somewhat new Git's feature, and your version might not support it / not support it in the way Magit expects it. What does git --version print?
    – wvxvw
    Commented Apr 26, 2017 at 13:27
  • By "Emacs 25" do you mean 25.1? This sounds like #26241 which is fixed in Emacs 25.2.
    – npostavs
    Commented Apr 26, 2017 at 14:36
  • "git is working fine through gitbash." - it might be good to double check it from cmd.exe
    – npostavs
    Commented Apr 26, 2017 at 15:04
  • It looks like it's having an issue finding your Emacs install which is uses to have you input the commit message. Does emacsclient.exe exist at c:/Users/George/Desktop/Emacs25/bin on your computer?
    – kfoley
    Commented Apr 26, 2017 at 17:47
  • @npostavs Yep, that did the trick. Downloaded the latest version (25.2) and everything works now! Thanks for the help
    – kxygk
    Commented Apr 27, 2017 at 3:53

1 Answer 1


It's an Emacs 25.1 bug, solved in 25.2

This is an instance of Emacs Bug#26310 which can be resolved by updating to Emacs 25.2, the relevant patch is here.

About troubleshooting

The *ERROR*: Wrong type argument: stringp, nil is from emacsclient, if you see this it means that git did succeed in calling it, so things are probably fine from git's point of view (i.e., it accepted the given options, and did find the executable).

The code that emacsclient executes runs inside a condition-case so you won't see any backtrace from errors even if you've set debug-on-error. You can get a backtrace by setting debug-on-signal (the *Backtrace* buffer will show up in the main Emacs frame, see #24616.17). An example backtrace that this bug would produce is here, the interesting part is at the top:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  (progn (isearch-cancel))
  (if (and (boundp (quote isearch-mode)) isearch-mode) (progn (isearch-cancel)))
  (save-current-buffer (set-buffer buffer) (if (and (boundp (quote isearch-mode)) isearch-mode) (progn (isearch-cancel))))

error: There was a problem with the editor '"c:/Users/George/Desktop/Emacs25/bin/emacsclient.exe"'.
Please supply the message using either -m or -F option.

This is from git, and (apart from the editor path) is just a generic error message that it prints when something goes wrong; especially, the suggestion about using -m or -F should be ignored.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.