Change git user [duplicate]

  Kiến thức lập trình

I wanna change my Windows git user details.

I use this command to change user name and email address:

git config --global user.email "[email protected]"
git config --global user.name "My Name"

But it shows me an error like this:

$ git push
remote: Permission to userName1/test.git denied to userName2.

fatal: unable to access 'https://github.com/userName1/test.git/': 

The requested URL returned error: 403

I have tried to change my Windows git user details using:

git config --global user.email "[email protected]"
git config --global user.name "My Name"

It changed my user name and email address globally but somewhere my previous account information was stored.

5

LEAVE A COMMENT