Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 850
Allen S Avatar asked Oct 18 '25 14:10

Allen S


2 Answers

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.

like image 150
Rob Bajorek Avatar answered Oct 21 '25 04:10

Rob Bajorek


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.

like image 34
Dale Myers Avatar answered Oct 21 '25 04:10

Dale Myers



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!