如何找到/列出全局 和用户配置 文件?我的意思是“Git-native 功能”,而不是像 find
这样的 Linux 突击队员。
最佳答案
在this question注释指出如何知道哪个文件与 --system
、--global
和 --local
相关。
简而言之,您只需使用--edit
到git config
:
git config --system --edit
git config --global --edit
git config --local --edit
如果您将环境变量 EDITOR
替换为例如echo
您可以在变量中接收它,即。您可以以编程方式使用它:
t=`EDITOR=echo git config --system --edit`
echo $t
在我的例子中打印 /etc/gitconfig
。
关于混帐配置 : locations of git configuration files,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14611610/