Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github The requested URL returned error: 403 remote: Permission to user

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,

  1. I created a repository with github id - joshinachiket

  2. I cloned the repository on a computer with .gitconfig showing same ID and email as shown above

  3. 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?

like image 285
Nachiket Joshi Avatar asked Nov 11 '17 23:11

Nachiket Joshi


2 Answers

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)

https://kwilson.io/blog/wp-content/uploads/2015/01/4-store.png

like image 183
VonC Avatar answered Oct 13 '22 11:10

VonC


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 enter image description here

like image 29
Do Nhu Vy Avatar answered Oct 13 '22 12:10

Do Nhu Vy