Aborting commit due to empty commit message

后端 未结 20 1939
[愿得一人]
[愿得一人] 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.

    0 讨论(0)
  • 2020-12-04 10:18

    I fixed the problem by switching from my fancy MacVim editor which opens a new window, to the standard default vim in /user/bin/vim which opens in the same window as the shell from whence it is called, and that seems to have fixed the problem.

    0 讨论(0)
提交回复
热议问题