Git mergetool not working

After the merge, I want to use git mergetool to solve the problem, but it does not work with any tool that I specify:

  git mergetool                                                                                                          
  merge tool candidates: opendiff kdiff3 tkdiff xxdiff meld tortoisemerge gvimdiff diffuse ecmerge p4merge araxis bc3 vimdiff emerge
 Merging:
 main.c

 Normal merge conflict for 'main.c':
   {local}: modified file
   {remote}: modified file
 Hit return to start merge resolution tool (kdiff3):
 merge of main.c failed

The tool that I specify does not start at all.

Conclusion

  git config --list 
 merge.tool = kdiff3
 core.repositoryformatversion = 0
 core.filemode = true
 core.bare = false
 core.logallrefupdates = true
+6
source share
2 answers

kdiff3 may not be installed on your system. If so, check if it is accessible via the PATH variable

Try

 git config --global merge.tool <your_merge_program> 

In addition, you can specify your operating system and available merge programs.

+5
source

Note that git 2.10 will offer the best exit status to determine the diff / merge tool installation issue.

See commit 45a4f5d (August 15, 2016) by John Keeping ( johnkeeping ) .
(merger of Junio โ€‹โ€‹C Hamano - gitster - on commit 331f06d , August 19, 2016)

difftool : always follow fatal error exit quotes

At the moment, the โ€œtrusted exitโ€ logic diffftool always suppresses the exit status of the diff utility that we invoke.
This is useful because we do not want to exit just because diff returned "1" because the files are different from each other, but confusing if the shell returns an error because the selected diff utility was not found.

Posix indicates

At least bash and dash follow this specification, while diff utilities usually use " 1 " for the exit status that we want to ignore.

Process any value of 126 or more as a special value indicating that some form of fatal error has occurred.

+1
source

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


All Articles