[英]git: where is my configuration information coming from?
我的git設置中有兩個沖突的配置定義。
$ git config --list|grep diff.tool
diff.tool=p4merge
diff.tool=extDiff
如何知道這些定義在MacOS系統上的哪個位置?
相關的Windows問題在這里: 我的配置中的這個值來自哪里?
此代碼片段將顯示可以配置的三個潛在位置。
$ 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
打開一個終端。 默認情況下,您應該在用戶家中。 運行ls -a
查看隱藏的文件.gitconfig
,它將具有用戶級別的配置。 在每個存儲庫中,運行相同的命令以找到.git
文件夾。 將目錄更改為( cd .git
),然后打開其中的config
文件,並確保其中沒有配置。
如果您不喜歡命令行文本編輯器,則可以運行open <insertfileName> -a textedit
在基本文本編輯器中打開文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.