如何设置合并“无快进"?作为 TortoiseGit 的默认设置? [英] How can I set merge "No Fast Forward" as the default in TortoiseGit?

查看:51
本文介绍了如何设置合并“无快进"?作为 TortoiseGit 的默认设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作流程中不使用快进合并.我注意到在 git 本身中,可以将其包含在他们的 .gitconfig 中以默认快速转发:

I don't use fast-forward merges in my workflow. I note that in git itself, one can include this in their .gitconfig to get fast forwarding off by default:

[merge]
    ff = false

不过,TortoiseGit 似乎对此没有任何作用.当我去合并时,No Fast Forward"复选框仍然没有被选中.当我执行合并时,我看到它仍然调用命令 git.exe merge Branch_test,没有 --no-ff 开关.

TortoiseGit doesn't seem to do anything with this, though. When I go to merge, the "No Fast Forward" checkbox is still unticked. When I carry out the merge, I see it still invokes the command git.exe merge Branch_test, without the --no-ff switch.

如何让它默认关闭?

推荐答案

啊哈!

设置

[merge]
    ff = false 

在配置文件中确实在使用 TortoiseGit 合并时阻止快进,因为这会改变 git.exe 本身的行为.

in the config file does prevent fast forwarding when merging using TortoiseGit, because that changes the behaviour of git.exe itself.

添加该选项后,合并对话框中的No Fast Forward"复选框不会做任何事情!相反,所有合并都将是No Fast Forward"合并.

With that option added, the "No Fast Forward" checkbox on the merge dialogue will not do anything! Instead, all merges will be "no fast forward" merges.

这有点笨拙,因为这意味着我在 TortoiseGit 对话框中没有选项来覆盖该默认值(即,在合并命令上使用 --ff 开关).不过,它大致满足了我的需要.

It's a bit clumsy, because it means I don't have the option in the TortoiseGit dialogue to override that default (ie, to use the --ff switch on the merge command). Still, it does approximately what I need.

这篇关于如何设置合并“无快进"?作为 TortoiseGit 的默认设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆