git - 使用 no-ff merge IntelliJ 任务

标签 git intellij-idea

我喜欢 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:

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/

相关文章:

java - 在 Intellij 中导入 Scala 库时出现问题

Python 诗歌无法克隆验证远程上是否存在引用

git push 分离远程和本地分支

Git 命令失败 HttpRequestException

java - 当我调用优化导入时,如何防止 IntelliJ 导入 JavaDocs 中使用的类?

grails - Grails应用无法以创建bean错误开始

java - Jar 缺少 Sun 类(class)

git rev-parse --git-path hooks 总是返回绝对路径

git - 如何在 git 日志图中显示相对提交号?

intellij-idea - IntelliJ 想法卡在 "loading project"屏幕上