Select an earlier commit message when commiting in EGit in Eclipse IDE?
Asked Answered
D

2

8

In EGit inside Eclipse IDE, I am missing the feature of a "commit message history", ie. being able to select one of the most recent commit messages for a new commit, a feature that I quite often use in CVS/SVN.

I see that in Eclipse IDE preferences at Git > Committing there ist a "Maximum number of commit messages in history". This hints at such a feature being present.

I just could not find/google how to access it? What would that option do otherwise? I also find my recent commits stored in the workspace metadata in a file called org.eclipse.egit.ui.prefs.

Please note that this is NOT about viewing the history of commits in the past, and therefore to my knowledge not a duplicate question!

Denby answered 7/3, 2018 at 12:51 Comment(6)
I would personally just use git log from the command line, but follow the duplicate link for an eGit solution.Renitarenitent
One option is to use git commit -c <commit> --reset-author from the command line. -c or -C allows you to reuse the message of that commit. -c is editable and -C is not.Whitefaced
In the Git Staging view, in the Commit Message field just hit Ctrl+Space (in contrast to SVN it is a content assist instead of a separate pull-down menu).Incommunicado
Please note that this is NOT about viewing the history of commits in the past, and therefore to my knowledge not a duplicate question! Ctrl+Space is the answer I was looking for, thanks a lot!Denby
Yeah, this is not in any way a duplicate question. Although it says "commit message history", it's about reusing (and editing) old commit messages, not about looking at the commit history. EGit provides a specific feature for doing this which isn't terribly ovious.Donielle
what is the mac shortcut?Seafowl
D
15

With the cursor in the "Commit message" box, press Ctrl+Space to show a list of previous commit messages. Select one and the "Commit message" box will be populated with that message.

Screenshot showing old commit messages

Donielle answered 7/3, 2018 at 13:13 Comment(1)
what's the shortcut on a mac??Seafowl
S
0

On Mac, this shortcut may not work for you, it is due to that shortcut is already set for toggling keyboard input source. You must disable that then ctrl+space works

Setting/Preference > Keyboard or Command+space, type "keyboard" press enter

Then, keyboard shortcut button > Input source(on the left)

Disable all of them or just disable the ctrl+space one and now you can use the shortcut to see the previous commit messages

Seafowl answered 19/10, 2023 at 14:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.