Git说:关键difftool.vs2012.cmd的值不止一个 [英] Git says: More than one value for the key difftool.vs2012.cmd

查看:105
本文介绍了Git说:关键difftool.vs2012.cmd的值不止一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天运行了这个命令两次,第二次尝试引用,因为该设置似乎没有效果:

  git config --global difftool.vs2012.cmdC:\程序文件(x86)\ Microsoft Visual Studio 11.0 \ Common7 \IDE\devenv.exe-diff$ LOCAL$ REMOTE

现在当我运行这个时:

  git config --global --get difftool.vs2012.cmd 



  C:\程序文件(x86)\ Microsoft Visual Studio 11.0 \ Common7 \\ \\IDE\devenv.exe 
错误:密钥difftool.vs2012.cmd的多个值:C:\程序文件(x86)\ Microsoft Visual Studio 11.0 \ Common7 \ IDE \ devenv .exe

请注意错误。



运行 git difftool -t vs2012 仍然不起作用,但我的问题是如何移除明显的重复键值对在Git配置文件中?



在输入这个问题时,我再次运行第一个命令,现在我似乎有3次!为什么它会一直添加越来越多而不是覆盖?



配置文件的位置在哪里,所以我可以使用记事本编辑它,而不是使用这种可怕的,糟糕的命令行语法?



我认为Git会很好地满足人们对此的兴趣。



PS以下问题没有提及如何解决它。



密钥user.name Git的多个值

解决方案

div>

要删除重复项,我必须在一个文本编辑器中编辑我的主目录(Windows配置文件)中的 .gitconfig p>

Git是Linux的一员,Linux的员工认为他们的工作方式符合上帝的设想,他们忽略了他们运行的Windows平台的线端,所以请注意不要在Windows上使用任何文本编辑器来破坏文件。


I ran this command twice today, the second time to experiment with the quotes because the setting didn't seem to have an effect:

git config --global difftool.vs2012.cmd "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" -diff "$LOCAL" "$REMOTE"

Now when I run this:

git config --global --get difftool.vs2012.cmd

I get this:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe
error: More than one value for the key difftool.vs2012.cmd: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe

Note the error.

Running git difftool -t vs2012 still doesn't work, but my question is how to remove the apparent duplicate key-value pair in the Git config file somewhere?

While typing this question, I ran the first command again and I now seem to have it 3 times! Why does it keep adding more and more instead of overwriting?

And where is the config file so I can edit it using Notepad instead of this awful, awful command line syntax?

I thought Git was going to be good the way people bang on about it.

P.S. The following question doesn't mention how to resolve it.

More than one value for the key user.name Git

解决方案

To remove the duplicates, I had to edit .gitconfig in my home directory (Windows profile) in a text editor that honors the line-endings.

Git, being a Linux thing, and Linux people thinking that the way they do stuff is in God's vision, they ignore the line-endings of the Windows platform they're running on, so be careful not to mangle the file by using just any text editor on Windows.

这篇关于Git说:关键difftool.vs2012.cmd的值不止一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆