Search code examples
gitnano

How to exit from commit edit message in git?


I usually commit by typing git commit -m "initial".

By default GNU nano editor is choice in git config.editor on ubuntu Gnome 19.04

And i accidentally commit my change typing git commitenter and GNU nano appear for editing commit message.
so How could i quit and return back to git terminal?

i went to look at this site : How do I exit from the text window in Git?
but didn't work for me. Git commit edit message


Solution

  • I was unaware of the convention that ^ means to press ctrl.

    So the solution is: Ctrl+X to abort, or Ctrl+z to stop.