I have two GitHub accounts with two different email IDs,
Currently, my .gitconfig is as follows;
[filter "lfs"]
process = git-lfs filter-process
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
[user]
name = joshinachiket
email = [email protected]
[core]
autocrlf = true
excludesfile = C:\\Users\\NACHIKET\\Documents\\gitignore_global.txt
Still, when I want to commit to the repository it says that,
remote: Permission to joshinachiket/CMPE295-enterprise-grade-botman.git denied to TheBloodMage.
fatal: unable to access 'https://github.com/joshinachiket/CMPE295-enterprise-grade-botman.git/': The requested URL returned error: 403
where TheBloodMage is my user id from other github email id.
The .gitconfig contents that I showed in the question are of the account in which I have created the repository and the ID TheBloodMage is of some other github account(my old) that I DON'T want to give access to.
So basically,
I created a repository with github id - joshinachiket
I cloned the repository on a computer with .gitconfig showing same ID and email as shown above
Still, the error says that TheBloodMage have no rights to access the repository.
I am stuck on this problem for a long time now... Can anyone please advise what am I doing wrong?
Double-check if you have a credential helper that would have cached your (old account) credentials (username/password) used to authentication you.
git config credential.helper
On Windows, that would be the Windows Credential Managers.
Open the Windows Credential Store, and see if the first user is registered there: delete that entry, and you will be able to authenticate with the second user.
(Here is an example for BitBucket)
You have GitHub repository: http://github.com/user_name/repository_name
You have 2 accounts, you want another account access to a exist repository.
Go to https://github.com/user_name/repository_name/settings/collaboration
do like this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With