Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I change the comment on a commit using git commit --amend?

Deleted user November 4, 2015

Hi,

I have opened the Terminal in SourceTree.  I am trying to change the comment on my previous commit by using git commit --amend.  This has produced a helpful window where I can edit my initial comment, but I can't figure out how to quit the edit and get the command to actually run.

Sorry this is a real newbie question, but any help would be most appreciated.

 

Kind wishes ~ Patrick

2 answers

1 accepted

1 vote
Answer accepted
Tim Crall
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 4, 2015

It's opened your default editor, which is probably vi if you haven't changed it.

 

If it is vi, hit escape to get out of edit mode and then hit colon.  A : prompt should appear at the bottom of the screen.  Hit w <enter> to save.  Then hit colon again and hit q <enter> to quit.

3 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 4, 2015

You can also do this without the Terminal by using the "Amend latest commit" Commit option:

image2015-11-4 14:29:58.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events