Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

How do I use VSCode as the configured git commit editor (and undo a failed settings attempt) [duplicate]

$
0
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.


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>