Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
设置自定义git配置文件位置_Git - Fatal编程技术网

设置自定义git配置文件位置

设置自定义git配置文件位置,git,Git,我正在使用Linux(Tcsh),我正在尝试设置一个自定义文件,该文件不在主目录中,可通过以下命令访问: git config --global user.name <user-name> 有可能吗?如果您希望git config使用不同的文件,例如~/.gitconfig(使用--global),请使用--file标志 git config --file=/path/to/my-git-config-file user.name Robert 有关详细信息,请考虑mangit-

我正在使用Linux(Tcsh),我正在尝试设置一个自定义文件,该文件不在主目录中,可通过以下命令访问:

git config --global user.name <user-name>

有可能吗?

如果您希望
git config
使用不同的文件,例如
~/.gitconfig
(使用
--global
),请使用
--file
标志

git config --file=/path/to/my-git-config-file user.name Robert
有关详细信息,请考虑
mangit-config

执行

git config --edit --global
然后添加行

[include]
    path = ~/someotherfile

是否可以使用env变量?@vesii env变量中将包含哪些内容?文件的路径?我正在运行一个执行
git-config
@vesii的包装器,所以您没有执行
git-config
?如果没有,你应该在问题中澄清这一点。这个包装器到底执行什么命令?一些只执行
git config--global user.name
的脚本。我无法修改命令仅设置环境变量如果您只需要输出,重定向
git config whatever>somefile
是否可以使用环境变量?我查看了您的问题的注释和编辑,不清楚您需要做什么。输出是什么意思?如果我的问题不清楚,很抱歉。我有一个运行git config命令的脚本。我无法编辑它,但我想设置文件的位置(而不是在不更改
$HOME
的情况下设置
$HOME
)。我是否可以设置一些变量来强制git配置使用此位置?请尝试man git配置,但我对此表示怀疑。你为什么不能编辑剧本?此外,为什么您不能自己运行这些命令?
[include]
    path = ~/someotherfile