Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using IntelliJ to amend git commit message

Can one amend a git commit message using IntelliJ, or should one resort to command line?

How can this be done please?

like image 481
James Raitsev Avatar asked Dec 28 '12 21:12

James Raitsev


People also ask

Can you edit git commit message?

You can change the most recent commit message using the git commit --amend command. In Git, the text of the commit message is part of the commit. Changing the commit message will change the commit ID--i.e., the SHA1 checksum that names the commit.


2 Answers

View => Tool Windows => Version Control. (Windows (Alt + 9) / OS X (Cmd + 9))

IntelliJ 2017.1 and higher => Go to Log and right click + reword or press F2.

IntelliJ rename commit

While you are on the same branch, ( your checked out branch is the same )

like image 78
Stefan Rein Avatar answered Sep 21 '22 18:09

Stefan Rein


Amend is supported: invoke "Commit Changes" and select the checkbox "Amend commit" in the Commit Dialog. Then press "Commit" button, and the commit will be amended to the previous one.

However, the support is limited:

  • you can't see the details of the commit being amended,
  • if you don't have any uncommitted changes (for example, you just want to change the message of the previous commit without adding more changes to it), you won't be able to invoke "Commit".
like image 21
LoKi Avatar answered Sep 21 '22 18:09

LoKi