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:

  • Should I worry about `git fsck` warning: “contains zero-padded file modes”
  • Git messed up my files, showing chinese characters in some places
  • Tortoise Git side-by-side with Tortoise SVN?
  • What's the equivalent in Git to a read-only component in ClearCase?
  • Git on Bitbucket: Always asked for password, even after uploading my public SSH key
  • How to get icon overlays with git-extensions
  • 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!

  • How to use --color-words with git add --patch?
  • View two different files on two different branches in Xcode?
  • Should I remove merged branches?
  • Can hard links get broken?
  • Git shortcut to pull with clone if no local there yet?
  • How to create reflogs information in an existing bare repository
  • 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.