git – Why does a commit abort with the error "Aborting commit due to empty commit message"?

Question:

trying to make a commit in git , writing a command

git commit

Displays the description of the commit via gedit (I think it doesn't really matter which text editor I use?), I save the changes and close it. And output

Aborting commit due to empty commit
message.

Everything works great with

git commit -m 'commit'

But I would like to get to the bottom of it. Can someone suggest why this is happening?

Answer:

Read error messages carefully. The one you have says that the description for the commit is not set. In the resulting gEdit window, you must specify a description for the commit in the first line of the file, write the file and exit.

Scroll to Top