公司策略是--no-ff用于合并提交.我个人喜欢调整合并日志消息,所以我使用--no-commit.另外,我想在提交之前进行实际的编译和测试.
如何为所有分支制作--no-ff和--no-commit默认?
(而且我在问这个以后的几年里学到了,我几乎总是对提交感到满意,因此默认情况下允许它提交更简单,只要我修改或以其他方式解决问题,然后再进行推送都好...)
Wil*_*ell 100
把它放在$ HOME/.gitconfig中:
[merge]
ff = no
commit = no
Run Code Online (Sandbox Code Playgroud)
您可以使用git-config执行此操作:
git config --global merge.commit no
git config --global merge.ff no
Run Code Online (Sandbox Code Playgroud)
Jia*_*ian 35
要进行--no-ff --no-commit默认合并行为,请将选项设置为no使用:
git config --global merge.ff no
git config --global merge.commit no
Run Code Online (Sandbox Code Playgroud)
但是,问题在于git pull= git fetch+ git merge.因此,无论何时从远程服务器拔出,都需要创建一个丑陋的合并提交,这样才能保证简单的快进.要解决此问题,请设置pull.ff为yes:
git config --global pull.ff yes
Run Code Online (Sandbox Code Playgroud)
gai*_*zka 20
从git版本1.7.6开始,你应该使用
git config [--global] merge.ff no
Run Code Online (Sandbox Code Playgroud)
--no-ff在每次合并中"强制"使用.
默认行为是
git config [--global] merge.ff yes
Run Code Online (Sandbox Code Playgroud)
与
git config [--global] merge.ff only
Run Code Online (Sandbox Code Playgroud)
它将拒绝非快进合并
ale*_*lue 10
根据手册,你应该使用
$ git config [--global] merge.ff false
Run Code Online (Sandbox Code Playgroud)
默认情况下,使用git-config实用程序为所有分支设置no-fast-forward选项.
| 归档时间: |
|
| 查看次数: |
19217 次 |
| 最近记录: |