1

I have saved my username globally in GIT when I check by using git config --global user.name command, it shows me correct username but it still keeps me asking username every time when I push or commit the code.

Does anyone have an idea?

Thanks in advance.

Pribhav
  • 236
  • 1
  • 7
  • 1
    `user.name` is not a ‘username’, but your full name that goes before the `<>` in your full e-mail address (always set both `user.name` and `user.email`!). – Jan Hudec May 31 '19 at 13:00

1 Answers1

2

Asking for your username when pushing is about authentication, not commit authorship.

Regarding authentication (credentials, username/password provided to a remote Git repository hosting service), you need to check your git config credential.helper: that setting can setup a cache, avoiding to request your credentials every time you are pushing.

As the OP Pribhav comments, you can as in this answer, embed the username in the URL (https://username@site/...).
Nut the credential.helper is still needed to avoid asking for your password.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Unless it is an SSH URL, but if it uses git@, it should not require your username. – VonC May 31 '19 at 13:00
  • Thanks for your quick response finally, https://stackoverflow.com/questions/11403407/git-asks-for-username-every-time-i-push#answer-11407483 it saved my time – Pribhav May 31 '19 at 13:16
  • Great! I have included your comment in the answer for more visibility. – VonC May 31 '19 at 13:22