我的问题是,我如何扩展我的.gitconfig文件中的RC变量?
我已经尝试以下:
> excludesfile = $ RC / globalgitignore
> excludesfile =!$ RC / globalgitignore
> excludesfile =!echo $ RC / globalgitignore
> excludesfile =!$(echo $ RC / globalgitignore)
这是唯一的方式,如果我输入完整的路径:excludesfile =〜/ rc / globalgitignore,但是我必须更改路径如果将我的rc目录移动到不同的位置。
The type specifier can be either –int or –bool,to make git config ensure that the variable(s) are of the given type and convert the value to the canonical form (simple decimal number for int,a “true” or “false” string for bool),or –path,which does some path expansion (see –path below). If no type specifier is passed,no checks or transformations are performed on the value.
–path的文档说明:
–path
git-config will expand leading ~ to the value of $HOME,and ~user to the home directory for the specified user. This option has no effect when setting the value (but you can use git config bla ~/ from the command line to let your shell do the expansion).
术语“扩展”不会出现在git-config(1)中的任何不同的上下文中。那么你是怎么得到应该的想法,因为没有这样的特征记录在任何地方?
为了扩展环境变量,你必须自己预处理Git配置文件,即通过创建模板文件,并在将文件复制到$ HOME目录之前用脚本展开变量。