我同步~/.gitconfig,并~/.gitignore通过使用Dropbox和符号链接创建为它在Ubuntu和Mac文件。
并且excludesfile是这样声明的。
[core]
editor = /usr/bin/vim
excludesfile = /Users/username/.gitignore
Run Code Online (Sandbox Code Playgroud)
问题是主目录因操作系统而异,因此我需要对 excludesfile 进行多个设置。
可以定义多个core.excludesfile吗?
Gil*_*il' 27
你只能有一个core.excludesfile; 最后一个设置是使用的那个。但是,您不需要多个文件:git 支持~作为您的主目录的缩写。
[core]
excludesfile = ~/.gitignore
Run Code Online (Sandbox Code Playgroud)
一般来说,如果你真的需要有多个排除文件,最简单的解决方案是生成一个文件,它是其他文件的串联,并在其中一个文件发生变化时更新它。