我想知道 [core] 是做什么的,以及如何设置它。我发现我的主目录中的 .gitconfig 文件是这样的:
[core]
autocrlf = input
safecrlf = true
[user]
name =
email =
在另一个主目录中,它看起来像这样:
[user]
name =
email =
[core]
excludesfile = /Users/chenfl84/.gitignore_global
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
最佳答案
参见 git-config(1)手册页,或运行 git help config
以获取有关如何安排 Git 配置的一般信息。
[core]
部分指的是控制 Git 行为“核心”的事物:如何识别文件和更新、缓存、压缩等。等等。< em>等等。
默认值通常——几乎总是——你想要的,但由于很多人确实想要自定义*crlf
选项,所以它们已经明确并放置在方便更换的地方。
关于git - .gitconfig 中的 [core] 有什么作用,如何设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15187693/