Mac Terminal Commands - how to come back after forgetting to close quotation marks Mac Terminal Commands - how to come back after forgetting to close quotation marks heroku heroku

Mac Terminal Commands - how to come back after forgetting to close quotation marks


This is more of a bash question than a git one.

For a forgotten quotation mark, see this answer on superuser.com.

Basically, press ctrl-c to cancel the current command, then the up arrow to retrieve your last line typed.

localhost: app myMac$ git commit -m "testing>

Whoops, hit ctrl-c.

localhost: app myMac$

Now press the up arrow ...

localhost: app myMac$ git commit -m "testing

and try again.


Just add " and press enter. If you want to fix the commit message to remove the new line run:

git commit --amend -m "Replacement commit"

This will change the last commit message to the new one.


Your shell knows there is a missing ". You can continue typing your message and finally enter the last " and it should take.

And if this fails there is always git commit --amend option to correct what went wrong.