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

Warning: Noob question ahead!

I’m using Heroku, and have forgetting to close the quotation marks when committing:

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

As you can see the last " is missing on the end of testing. Now I’ve got the > sign and I’m unsure how to get out of it? This must be a trivial thing but I just can’t get a grip of it!

  • Cannot use git in Android Studio's terminal
  • Git/source tree move specific commits at branch B to branch A
  • Coloured Git diff to HTML
  • Initialize gitolite repository in existing folder
  • How to change the language of my git?
  • Make bash commands to fall back to git commands if git command exists
  • fatal: read error: Connection reset by peer
  • Git Log not showing accents
  • 3 Solutions collect form web for “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.

    Git Baby is a git and github fan, let's start git clone.