我喜欢 IntelliJ 任务来简化我的工作流程。但是,当我关闭任务并检查 merge with branche(s)
时,它 merge 了我的功能分支,没有 no-ff
.
如何启用 no-ff
与 IntelliJ 任务?
最佳答案
如果您可以在 Git 中全局使用快进 merge ,那么 the following solution可能会更好,因为它适用于所有项目:
It seems as if IntelliJ does honour global configuration values. Having set this, upon performing a merge it creates a proper merge commit, even when performing the merge from the UI. It even displays a popup offering to delete the source branch.
$ git config --global --add merge.ff false
来自 Intellij文档(自 2020.2 起):
If you need to specify merge options, from the main menu choose VCS Git | Merge Changes to open the Merge dialog:
Select the branch that you want to merge into the current branch, click Modify Options and choose from the following:
--no-ff: a merge commit will be created in all cases, even if the merge could be resolved as a fast-forward.
--ff-only: the merge will be resolved only if it is possible to fast-forward.
--squash: a single commit with all pulled changes will be created on top of the current branch.
-m: you will be able to edit the message for the merge commit.
--no-commit: a merge will be performed, but a merge commit will not be created so that you can inspect the result of the merge before committing.
Click Merge.
关于git - 使用 no-ff merge IntelliJ 任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40340980/