I’m a novice in Git and I have started learning Git by using the free online book. I have few doubt to clear:
I have used this command to set up my Git:
$ git config --global user.name "Anto"
Later on I just used this command:
$ git config user.name "anto aravinth"
(that is without the --global option)
And now when I run with the following command:
$ git config --list
I’m getting the output as:
user.name=Anto
user.email=anto.aravinth.cse@gmail.com
push.default=matching
color.status=auto
color.branch=auto
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
user.name=anto aravinth
In the above command I can see two user.name field with the values anto and anto aravinth respectively. So whats the point of two user.name here? To allow more than one user on the same system or what else? As I’m a novice it will be good if the answer is simple enough.
Thanks in advance.
As mentioned in
git configman page:GIT_AUTHOR_NAMEandGIT_COMMITTER_NAMEwill override local config (config within a current repo)$HOME/.gitconfig, which supposes you have define an environment variableHOME, knowing that it isn’t defined by default on Windows)Note that
git config --list --localcan have several error message:(if done outside of a git repo directory)
(if done with git1.7.1 or less and run outside a git repo, as illustrated by this git-dropbox ticket. The solution was to ignore the error message:
)