当git config --global用于设置时,它将写入哪个文件?
例:
git config --global core.editor "blah"
Run Code Online (Sandbox Code Playgroud)
我在这些地方找不到它:
C:\Program Files\Git\etc\gitconfig
C:\myapp\.git\config
Run Code Online (Sandbox Code Playgroud)
我还没有设置ENV?
我的Git版本:1.6.5.1.1367.gcd48 - 在Windows 7上
是否有文件或菜单可以让我更改如何处理行结尾的设置?
有3种选择:
结帐Windows风格,提交Unix风格
签出文本文件时,Git会将LF转换为CRLF.提交文本文件时,CRLF将转换为LF.对于跨平台项目,这是Windows上的推荐设置("core.autocrlf"设置为"true")
Checkout as-is,提交Unix风格
签出文本文件时,Git不会执行任何转换.提交文本文件时,CRLF将转换为LF.对于跨平台项目,这是Unix上的推荐设置("core.autocrlf"设置为"input").
按原样结帐,按原样提交
签出或提交文本文件时,Git不会执行任何转换.不建议跨平台项目选择此选项("core.autocrlf"设置为"false")
我注意到core.autocrlf我跑的时候有两个列表git config -l
$ git config -l
core.symlinks=false
core.autocrlf=false
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
user.name=name
user.email=email@example.com
core.autocrlf=true
Run Code Online (Sandbox Code Playgroud)
最后3个(来自user.name)是我C:\users\username\.gitconfig文件中唯一的.所有其他的来自哪里?为什么core.autocrlf列出两次?
这是使用msysgit 1.8.3,我也安装了SourceTree(Windows 7).在SourceTree中,我取消选中"允许SourceTree修改全局Git配置文件"
我试图弄清楚core.autocrlf如果用户没有更改此设置,Git中的默认值是什么.
我查看了文档但找不到此信息.你能指点我正确的方向吗?
具体来说,在新的Git安装上,Git会在从Windows系统提交回购时自动将Windows行结尾转换为Unix吗?
谢谢!
我在 Windows 7 中安装了 git 2.6.2。
我已经core.autocrlf设置为False. 我想知道那个设置是从哪里来的。我有以下奇怪的行为:
> cd c:\
> git config --global --list | select-string autocrlf
> git config --system --list | select-string autocrlf
fatal: unable to read config file 'C:\Program Files\Git\mingw64/etc/gitconfig': No such file or directory
> git config --list | select-string autocrlf
core.autocrlf=false
core.autocrlf=False
> git config core.autocrlf
False
Run Code Online (Sandbox Code Playgroud)
所以我没有core.autocrlf在全局配置中设置。我没有系统配置。我目前不在 git 目录中。不过,我得到不少于两个 core.autocrlf设置。它们是由 Git 二进制文件生成的吗?(如果是这样,为什么有两个设置?)