Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Eclipse/EGit is there a way to edit commit message of unpushed/local commit?

Tags:

git

eclipse

egit

Using Eclipse/EGit how do I edit a commit message of a commit I've made locally, but haven't pushed to the repository yet?

like image 382
Grzegorz Oledzki Avatar asked Jan 31 '14 08:01

Grzegorz Oledzki


People also ask

How do you edit an existing Unpushed commit message?

If you are using the Git GUI tool, there is a button named Amend last commit. Click on that button and then it will display your last commit files and message. Just edit that message, and you can commit it with a new commit message.

How do I change commit message in EGit?

That would be the "Amending Commits" section of the EGit User Guide: open the Staging View or Commit Dialog again and select the option Amend previous commit in the toolbar.

How do I edit an existing commit?

Changing the Last Commit: git commit --amend. The git commit --amend command is a convenient way to modify the most recent commit. It lets you combine staged changes with the previous commit instead of creating an entirely new commit.


2 Answers

That would be the "Amending Commits" section of the EGit User Guide:

open the Staging View or Commit Dialog again and select the option Amend previous commit in the toolbar.

See also this tutorial:

Git amend allows to adjust the last commit.
For example you can change the commit message.
The Git Staging view allows you to perform the Git amend command via the highlighted button in the following screenshot.

See more about git commit --amend in general at "The git commit --amend Command".

http://www.vogella.com/tutorials/EclipseGit/images/xegitamend10.png.pagespeed.ic.m-4qbTQTEv.png

99sono adds in the comments:

I use:

Team Synchronizing Prespective > History View > Modify
(submenu) > Reword .
Finally this opens a popup where I can edit the old commit message.

See "Add ability to reword and squash commits directly from the history view"

like image 142
VonC Avatar answered Sep 20 '22 00:09

VonC


You can select the commit and right click, then:

Modify -> Edit 

to rebase onto that commit, amend it and then continue.

like image 21
softwarevamp Avatar answered Sep 21 '22 00:09

softwarevamp