0

运行git difftool时,系统会提示我输入文件差异,即使prompt = false我的 .gitconfig 文件中有。

来自 .gitconfig 的片段

[diff]
  tool = p4mergetool
  renames = copies
  mnemonicprefix = true
[difftool "p4mergetool"]
  cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "$LOCAL" "$REMOTE"
  keepBackup = false
  keepTemporaries = false
  trustExitCode = false
  prompt = false

我的 .gitconfig 条目基于Ask Different exchange 上的这个答案

macOS 终端输出(bash)

$ git difftool factory-test HEAD -- $(git difftool factory-test HEAD --name-only *.c *.h)
查看 (1/13): 'factory_test/config/sl_spidrv_usart_spidrv_config.h'
Launch 'p4mergetool' [是/否]?Y
查看(2/13):“factory_test/app.c”
启动“p4mergetool”[Y/n]?

如何让提示抑制生效?

我的版本信息:

  • p4merge(修订版 Helix Merge/MACOSX1015X86_64/2021.1/2085655)
  • 混帐(混帐版本 2.31.1)
  • macOS Catalina(版本 10.15.7)
4

1 回答 1

0

这是解决方案:

[diff]
  tool = p4mergetool
[difftool]
  prompt = false
[difftool "p4mergetool"]
  cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "$LOCAL" "$REMOTE"
  keepBackup = false
  keepTemporaries = false
  trustExitCode = false
于 2021-04-22T18:51:08.577 回答