How can I set up an editor to work with Git on Windows?

后端 未结 30 1349
悲哀的现实
悲哀的现实 2020-11-22 13:57

I\'m trying out Git on Windows. I got to the point of trying \"git commit\" and I got this error:

Terminal is dumb but no VISUAL nor

30条回答
  •  再見小時候
    2020-11-22 14:18

    Notepad++ works just fine, although I choose to stick with Notepad, -m, or even sometimes the built-in "edit."

    The problem you are encountering using Notepad++ is related to how Git is launching the editor executable. My solution to this is to set environment variable EDITOR to a batch file, rather than the actual editor executable, that does the following:

    start /WAIT "E:\PortableApps\Notepad++Portable\Notepad++Portable.exe" %*
    

    /WAIT tells the command line session to halt until the application exits, thus you will be able to edit to your heart's content while Git happily waits for you. %* passes all arguments to the batch file through to Notepad++.

    C:\src> echo %EDITOR%
    C:\tools\runeditor.bat
    

提交回复
热议问题