git 在 Eclipse/EGit 中有没有办法编辑未推送/本地提交的提交消息?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21475844/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 17:39:24  来源:igfitidea点击:

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

eclipsegitegit

提问by Grzegorz Oledzki

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?

使用 Eclipse/EGit 如何编辑我在本地进行但尚未推送到存储库的提交的提交消息?

回答by VonC

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

那将是EGit 用户指南的“修改提交”部分:

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.

Git amend 允许调整最后一次提交。
例如,您可以更改提交消息。
Git 暂存视图允许您通过以下屏幕截图中突出显示的按钮执行 Git 修改命令。

See more about git commit --amendin general at "The git commit --amendCommand".

查看更多关于git commit --amend一般在“git commit --amend命令”。

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

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

99sonoadds in the comments:

99sono在评论中补充道:

I use:

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

我用:

Team Synchronizing Prespective> History View> Modify
(子菜单)> Rework.
最后这会打开一个弹出窗口,我可以在其中编辑旧的提交消息。

回答by softwarevamp

You can select the commit and right click, then:

您可以选择提交并右键单击,然后:

Modify -> Edit

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

重新基于该提交,修改它然后继续。