0

I am using VSCode on Windows to connect to a remote Linux system. My starting point for difficulties was that on the occasions when I got into a git merge conflict, VSCode was opening the merge commit windows in emacs, which I don't like.

A colleague pointed me to How to prevent the standard git merge editor from being used in the VS Code terminal?, which got me partway to a good outcome. I ran export GIT_EDITOR="code" from the command line and lo, enterinng an unadorned git commit kicked me into a new VSCode editor window to edit the commit message. Yay!

However ... when I edited a commit message into that window and then saved and closed it, git responded with Aborting commit due to empty commit message. So, QUESTION 1: how do I work with the VSCode editor in this situation so that it recognizes the commit message I've entered as being non-null?

Then I made things worse by poking around further and trying git config --global core.editor "code -w" from Aborting commit due to empty commit message. The result was that plain git commit now responds immediately with Aborting commit due to empty commit message. without giving me a chance at an editor window for the commit. Thus, QUESTION 2: how do I undo that git config command? I've tried git config --unset-all core.editor as recommended by some other SO pages, and some other variations like git config --global core.editor "vim", but none of them are having any apparent effect.

David Kaufman
  • 989
  • 1
  • 7
  • 20

0 Answers0