PalPalash
PalPalash

Reputation: 142

What is the purpose of git config user.name/user.email?

I have used git a lot. I am wondering how does git authenticate because

git config --global user.name "Jane Doe"
git config --global user.email "[email protected]"

does not ask for password.

I can push without the password. Does this mean anyone with my email can push to my github account?

Upvotes: 0

Views: 1481

Answers (1)

VonC
VonC

Reputation: 1323773

The user.name/email is not about remote authentication, but about local commit authorship (the committer user name/email associated with the commit you are creating locally)

If you push without entering any credentials, it can be:

  • because you are using an HTTPS URL and the credentials were already cached by the git config credential.helper
  • because you are using an SSH URL and:
    • the private key is not passphrase-protected
    • or the private key is passphrase-protected and said passphrase is added to a running ssh-agent

Upvotes: 2

Related Questions