Aborting commit due to empty commit message

后端 未结 20 2050
[愿得一人]
[愿得一人] 2020-12-04 09:45

As a newbie git user, when I try to commit my work with

git commit -a -v

and I enter a commit message in my editor, I close the file, and g

20条回答
  •  忘掉有多难
    2020-12-04 10:17

    For commenting on Notepad++ (Windows) do this:

    1. Create a batch file somewhere (e.g. c:\Users\me\scripts\npp.bat)
    Write this in the batch file (depending on where your Notepad++ is installed):

    "C:\Program Files\Notepad++\notepad++.exe" -multiInst -notabbar -nosession -noPlugin "$*"
    

    2. Save the batch file.
    3. Open .gitconfig (which is usually in your Windows User folder) and make sure that
    under [core] section you have:

    editor = '"c:\\Users\\me\\scripts\\npp.bat"'
    

    Or either run:

    git config --global core.editor '"c:\Users\me\scripts\npp.bat"'
    

    4. Now perform commit of some kind, and it will open Notepad++, git commit will now wait until notepad++ window is closed.

提交回复
热议问题