【问题标题】:Setting git diff to use diffmerge设置 git diff 以使用 diffmerge
【发布时间】:2014-02-04 18:38:18
【问题描述】:

我想将我的 git 设置为使用 diffmerge 作为默认差异编辑器,而不是默认的 Unix diff

git config --global diff.external diffmerge

不幸的是,当我这样做时

git diff myfile.txt

我从 DiffMerge 中得到以下错误(以弹出窗口的形式):

Unexpected parameter '100644'

Command Line Arguments:
[0]: /Applications/DiffMerge.app/Contents/MacOS/DiffMerge
[1]: --nosplash
[2]: myfile.txt
[3]: /var/folders/_r/xjwgmj811yq5x7n7mb9z0pzc0000gn/T//pNIOTmyfile.txt
[4]: 95cbe334d3ec607ca7f7bd3fd16d630271e9d0af
[5]: 100644
[6]: myfile.txt
[7]: 0000000000000000000000000000000000000000
[8]: 100644

你能告诉我我做错了什么吗?

【问题讨论】:

标签: git git-diff diffmerge


【解决方案1】:

改用这个

git config --global diff.tool diffmerge
git config --global difftool.diffmerge.cmd "diffmerge \$LOCAL \$REMOTE"

有很多博客文章和文章解释了如何将 diffmerge 配置为默认的 diff 或合并工具。以http://adventuresincoding.com/2010/04/how-to-setup-git-to-use-diffmerge/ 为例

【讨论】:

  • 实际上,当我使用git difftool 而不仅仅是git diff 时效果很好。唯一的烦恼是,如果我想弹出 diffmerge,它会要求我确认 Y/N。有什么方法可以覆盖默认的确认(总是是)而不用管道回显 Y?
  • 100644 似乎是 git 中的经典文件模式。 git book 中有很多引用它。例如git-scm.com/docs/gitdiffcore
  • 同一个问题你也已经有了答案...stackoverflow.com/questions/21486481/…
  • 不完全是,没解释difftool.diffmerge.cmd
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-10-21
  • 1970-01-01
  • 1970-01-01
  • 2012-05-21
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多