简体   繁体   English

如何在Eclipse中git merge squash

[英]How to git merge squash in Eclipse

Sometimes I need to merge squash from Eclipse. 有时我需要合并来自Eclipse的壁球。 I know I can do it in command line, but it will be really useful to have graphic option integrated in Eclipse. 我知道我可以在命令行中执行此操作,但在Eclipse中集成图形选项非常有用。 Do you know how to do it? 你知道怎么做吗?

You can start an interactive rebase in EGit , and select squash for the commits you want squashed. 您可以在EGit中启动交互式rebase ,并为您想要压缩的提交选择squash。

http://wiki.eclipse.org/images/0/0b/Egit-3.2-InteractiveRebaseView.png


Note: for squashing the last few commits, historically the other way was a soft reset (see this thread ) 注意:对于压缩最后几次提交,历史上另一种方式是软复位(参见此线程

  • select in history the first commit which I don't want to squash 在历史中选择我不想压缩的第一个提交
  • right-click and say " Team->Reset->Soft " 右键单击并说“ Team->Reset->Soft
  • right-click and say " Commit ". 右键单击并说“ Commit ”。 This commit will contain all the changes of the last m commits together 此提交将包含最后m次提交的所有更改

Just open the context menu on your project and choose Team > Merge... . 只需打开项目的上下文菜单,然后选择Team > Merge .... In the resulting dialog select the option "Squash" and the branch to merge. 在结果对话框中选择“壁球”选项和要合并的分支。

Also see VonC's answer for other options. 另请参阅VonC对其他选项的回答。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM