【问题标题】:git: where is my configuration information coming from?git:我的配置信息来自哪里?
【发布时间】:2016-04-29 14:22:53
【问题描述】:

我的 git 设置中有两个冲突的配置定义。

$ git config  --list|grep diff.tool
diff.tool=p4merge
diff.tool=extDiff

我如何知道这些定义在我的 MacOS 系统上的设置位置?

这里有相关的windows问题:Where is this value in my configuration coming from?

【问题讨论】:

    标签: git macos version-control


    【解决方案1】:

    这个 sn-p 将显示可以设置配置的三个潜在位置。

    $ for i in local global system; do echo $i:;git config  --$i --list|grep diff.tool;done
    local:
    global:
    diff.tool=p4merge
    diff.tool=extDiff
    system:
    fatal: unable to read config file '/usr/local/etc/gitconfig': No such file or directory
    

    【讨论】:

      【解决方案2】:

      打开一个终端。默认情况下,您应该在您的用户家中。运行ls -a,查看隐藏文件.gitconfig,里面会有用户级别的配置。在每个存储库中运行相同的命令以查找 .git 文件夹。将目录更改为它(cd .git),并打开其中的config 文件并确保其中没有配置。

      如果您不喜欢命令行文本编辑器,您可以运行 open <insertfileName> -a textedit 在基本文本编辑器中打开文件。

      【讨论】:

        猜你喜欢
        • 2019-01-31
        • 1970-01-01
        • 2021-11-21
        • 1970-01-01
        • 2011-12-10
        • 2014-05-24
        • 2021-01-19
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多