I'm new to GIT. I downloaded GIT for Windows from a GitHub link a few days ago. I'm using the command line tool MinGW32. I'm not comfortable with the default editor so I've been trying to set up my favourite editor.
I followed the instructions here to use EditPad Pro as my editor. But I keep getting the following message:
Aborting commit due to empty commit message.
EditPad Pro opens a new instance. MinGW32 is waiting because I don't get the abort message until after I close EditPad Pro. When the editor opens, it opens with a blank file called COMMIT_EDITMSG
. When I close the editor, the file saves to the main directory for the repo.
I found a clue in this answer, specifically this phrase:
[Vim] saves the file to .git/COMMIT_EDITMSG by default
If I do a Save As to save the file to the .git directory before closing the editor, then it works. However, there are two problems with that:
- I have to remember to Save As
- I don't get the helpful comments that Git adds by default to COMMIT_EDITMSG
The current config setting for core.editor
is:
"'D:\Program Files\JGsoft\EditPadPro5\EditPad Pro.exe' //newinstance"
I'm not sure what the $*
mentioned in the instructions is for, but I tried it with and without that and also assorted variations with and without single/double quotes. I tried setting the value in a shell script as well. At worst, it doesn't work at all (e.g. won't even open the editor) and at best it opens a blank file.
How do I get my editor to open with the file that Git created in the .git directory?
EDIT: I get the exact same results whether I use $*
or not, and this answer says it's not needed. This Git Pro page makes mention of it when explaining how to set up external merge and diff tools, but makes no mention of it when explaining the core.editor
config setting. Note: I also tried %*
.
If the $*
variable was needed (and missing), I would think that EditPad Pro would open with a blank Untitled file rather than a blank COMMIT_EDITMSG file in the current directory. The problem seems to be the path.
EDIT: I've done more experimenting. I have spaces in my file path and I thought that might be causing a problem. I cloned my repo into a new directory with no spaces in the name and fixed my config variables. It didn't solve the problem. But I noticed another problem. In some of my tests, the blank file that was loaded into the editor was named $@
.