I wish to know what does [core] do, and how to set it up in general. I found the .gitconfig file in my home directory to be this:
[core]
autocrlf = input
safecrlf = true
[user]
name =
email =
In another home directory, it looks like this:
[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
The git-core package is a "dummy" package, which has the git package as dependency. This is because the git-core package has been renamed to git . The dummy git-core package should be safely removable. In previous releases, it seems git was a virtual package for gnuit (GNU Interactive Tools).
The git config command is a convenience function that is used to set Git configuration values on a global or local project level. These configuration levels correspond to . gitconfig text files. Executing git config will modify a configuration text file.
The git config core. autocrlf command is used to change how Git handles line endings. It takes a single argument. On macOS, you simply pass input to the configuration. For example: $ git config --global core.autocrlf input # Configure Git to ensure line endings in files you checkout are correct for macOS.
How to do a git config global edit? The global git config is simply a text file, so it can be edited with whatever text editor you choose. Open, edit global git config, save and close, and the changes will take effect the next time you issue a git command. It's that easy.
See the git-config(1) man page, or run git help config
for general information on how Git configuration is arranged.
The [core]
section refers to things that control the “core” of Git’s behavior: how files & updates are recognized, caching, compression, etc., etc.
The defaults are usually—just about always—what you want, but since many people do want to customize the *crlf
options, they have been made explicit and put in a place convenient for changing.
Each [section]
begins a section that contains values. You could edit the file manually, or use git config
, e.g.
git config --global core.name Pippi # < value
# section ^ ^ key
git help config
has a list of options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With