如何使 git merge 的默认设置为 --no-ff --no-commit? [英] How do I make git merge's default be --no-ff --no-commit?
问题描述
公司政策是使用 --no-ff
进行合并提交.我个人喜欢调整合并日志消息,所以我使用 --no-commit
.另外,我喜欢在提交之前实际编译和测试.
Company policy is to use --no-ff
for merge commits. I personally like to adjust merge log messages so I use --no-commit
. Plus I like to actually compile and test before I let the commit go.
如何让 --no-ff
和 --no-commit
成为我所有分支的默认设置?
How do I make --no-ff
and --no-commit
the default for me for all branches?
(自从问这个问题以来,我多年来学到了,我几乎总是对提交感到满意,所以默认情况下允许它提交更简单,只要我在做之前修改或以其他方式解决问题推东西都是好的...)
(and I've learned in the years since asking this, I almost always am happy with the commit, so it is simpler to allow it to commit by default and so long as I amend or otherwise fix things up before doing a push things are all good...)
推荐答案
把这个放在 $HOME/.gitconfig:
Put this in $HOME/.gitconfig:
[merge]
ff = no
commit = no
您可以使用 git-config 来执行此操作:
You can use git-config to do this:
git config --global merge.commit no
git config --global merge.ff no
这篇关于如何使 git merge 的默认设置为 --no-ff --no-commit?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!