我们git 1.8
在混合环境(OSX、Linux、Windows)中进行设置,并且有些文件名使用非英文字符。我读过这core.precomposeunicode
需要true
在 OSX 系统上设置。
我们不关心向后兼容性。我们关心的是让开发人员的事情变得简单。我们宁愿不必解释git
配置。
那么:全局设置该标志是否安全(在中央 git 服务器中)?这会加强我们需要的一致性吗?有理由不这样做吗?
我们git 1.8
在混合环境(OSX、Linux、Windows)中进行设置,并且有些文件名使用非英文字符。我读过这core.precomposeunicode
需要true
在 OSX 系统上设置。
我们不关心向后兼容性。我们关心的是让开发人员的事情变得简单。我们宁愿不必解释git
配置。
那么:全局设置该标志是否安全(在中央 git 服务器中)?这会加强我们需要的一致性吗?有理由不这样做吗?
No, that won't work. There is no such thing as a central git server in a distributed version control system - at least not in the technical sense.
Each developer has his own repository to which he checks in his changes. When those changes are pushed to the repository you declare as central, the data is not re-processed.
You will have to set that configuration on every local repository.
Unfortunately, there is no alternative with .gitattributes either.
Local options for a certain repository that will then be cloned by the developers isn't an option either. The following simple experiment shows this:
d:\Temp\Origin>git init
Initialized empty Git repository in d:/Temp/Origin/.git/
d:\Temp\Origin>git config --local --add core.autocrlf input
d:\Temp\Origin>git config --local --list
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.hidedotfiles=dotGitOnly
core.autocrlf=input
d:\Temp\Origin>cd ..
d:\Temp>git clone d:\Temp\Origin Developer
Cloning into 'Developer'...
warning: You appear to have cloned an empty repository.
done.
d:\Temp>cd Developer
d:\Temp\Developer>git config --local --list
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.hidedotfiles=dotGitOnly
remote.origin.url=d:\Temp\Origin
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
Note how the call to git config --local --list
in Origin
lists core.autocrlf=input
and the same command in Developer
doesn't, although we just cloned Developer
from Origin
.
That demonstrates that repository-local configuration values are not cloned.