Turn off quick merge to merge regularly, but not to stretch

I want git to always do merge transactions ( --no-ff ) when I use git merge , but keep the default behavior ( --ff ) for git pull . Is this possible (with configs)?

+6
source share
2 answers

Two configurations that can help you:

 merge.ff 

(From git merge man page ): if set to false , this variable tells Git to create an additional commit merge in this case (equivalent to providing the --no-ff option from the command line).

 pull.ff 

(from git config man page )

Setting pull.ff to true will support the default behavior when Git does not create an additional join when combining a commit that is a descendant of the current commit.

To test: pull.ff takes precedence over merge.ff ?

 git config pull.ff only git config merge.ff false 

As Kelvin mentioned the answer and confirmed by git-pull.sh , ' only ' is a value that is not used, not < true .

+3
source

Here is my preliminary workflow (note that the pull.ff configuration parameter only works on git 2.x.).

Use this configuration:

  • Set merge.ff to false . The default value for the merge parameter is --no-ff .
  • Set pull.ff to only . The default pull parameter is set to --ff-only .

This means that if you try to find the pull branch where your locale is behind and in front of the remote, pull will fail. In this case, rebase so that you no longer fall behind.

Note:

I tried setting pull.ff to true , but git seems to handle it as if this option were completely disabled. Note that the man page does not mention that true is a recognized value.

+3
source

Source: https://habr.com/ru/post/982773/


All Articles