ramonaLi
ramonaLi

Reputation: 43

Unable to commit files to Git Bash on macOS High Sierra 10.13.3

I've configured my core editor, and everything works just fine. I can open any file in my editor, from the command line.

But, when I get to 'git commit' I'm getting this error:

hint: Waiting for your editor to close the file... fatal: cannot run --
unset-all: No such file or directory
error: unable to start editor '--unset-all'
Please supply the message using either -m or -F option.

I've tried with Sublime first, than Brackets and Atom. I've even tried to reset the .gitconfig (rm ~/.gitconfig) and nothing changed.

It's there any command to fix this error? Or do I have to uninstall git?

Upvotes: 2

Views: 3641

Answers (3)

Simon Tomkins
Simon Tomkins

Reputation: 1

I was getting the same error, was trying to use an alias as the path. Found using the full path to sublime cleared the problem.

Upvotes: 0

R.K
R.K

Reputation: 13

It could also be that you forgot to add a message after your commit. For example: git commit -m "This is my message"

Upvotes: 1

kowsky
kowsky

Reputation: 14429

As @MarkAdelsberger noticed, you seem to have set your editor to --unset-all. Maybe you confused the order of arguments and called git config --global core.editor --unset-all? That would lead to the situation you describe.

Git has three levels of settings: global, system and local (repository). Deleting ~/.gitconfig will only get rid of the global settings, so maybe you screwed somewhere and changed the editor configuration on another level. You can try to reset the editor settings on all levels with with the correct syntax:

git config --global --unset-all core.editor
git config --system --unset-all core.editor
git config --unset-all core.editor

This should reset to the default editor.

Upvotes: 5

Related Questions