emeraldinspirations
emeraldinspirations

Reputation: 166

Where does git store the commit message

I was doing a commit and noticed I had made a mistake. Since closing nano would commit the change, I force-closed the terminal. This left the .swp file somewhere, preventing me to commit in the future:

*** Error in `nano': malloc(): memory corruption (fast): 0x000000000204a990 ***
error: nano died of signal 6
error: There was a problem with the editor 'nano'.
Please supply the message using either -m or -F option.

Upvotes: 4

Views: 4151

Answers (2)

Altaf Ur Rehman
Altaf Ur Rehman

Reputation: 11

If you want to change the commit message, you can use this command

git commit --amend

This will allow you to modify your commit, as well as your commit message on your local branch. After modifications, push the branch to remote repository to reflect changes there.

Upvotes: 0

emeraldinspirations
emeraldinspirations

Reputation: 166

The file is located in the .git folder, the file is named "COMMIT_EDITMSG".

To fix the issue, go to the project's main folder and type:

$ rm ./.git/.COMMIT_EDITMSG.swp

Upvotes: 7

Related Questions