Question

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
Était-ce utile?

La solution

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.

Autres conseils

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top