How to skip "Hit back to start merge resolution tool" and open mergetool automatically

Git asking you to press the back button to open the mergetool file for each conflict file one by one:

> git mergetool Normal merge conflict for '...': {local}: modified file {remote}: modified file Hit return to start merge resolution tool (opendiff): 

How can I avoid the return to uninstall step for my project and just open the configured merge tool automatically?

+6
source share
3 answers

Use the -y flag. From the doc:

-y
--no-prompt
Do not run a merge program before each call.

+7
source

To skip the invitation forever, run:

 git config --global mergetool.prompt false 

To skip it for a single git mergetool run, go --no-prompt -y or --no-prompt :

 git mergetool -y 
+10
source

Note. GIt 2.0.x (Q3 2014) does not display this message if you have clearly defined your merge.tool .
No need for -y .

See commit 4ecc63d Felipe Contreras ( felipec ) :

mergetool : run the prompt only if the guessed tool

It is annoying to see the invitation:

 Hit return to start merge resolution tool (foo): 

Each time the user does a “ git mergetool ”, even if the user has already configured “ foo ” as the required tool.

Display this prompt only if the user has not explicitly configured the tool.

See git-mergetool--lib.sh#L323-L339 for the “explicitly defined” part: git config merge.tool


This is explained by commit c15bb0c :

 -y:: --no-prompt:: 

Do not request before each call to the merge program.

This is the default if the merge resolver is explicitly specified with the --tool option or with the merge.tool configuration merge.tool .

 --prompt:: 

A request before each call to the merge permission program to enable the user to skip a path.

+1
source

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


All Articles