Reputation: 21
remote: Permission to myUsername/MyProject.git denied to Dwannnn.
fatal: unable to access 'https://github.com/joshuakimDwan/MyProject.git/': The requested URL returned error: 403
I got this error in my terminal.
My step is:
1. git init
2. git remote add origin https://github.com/myUsername/MyProject.git
3. git add README.md
4. git commit -m "first commit"
(error) 5. git push -u origin master
when git push, I got that error. It means 'Dwannnn' cannot be permitted. But, in ~/.gitconfig, my username is not 'Dwannnn'. I don't know what the name is.
In my guess, I used account which name is 'Dwannnn' when I practiced Git using Sourcetree. So, I removed account, network data of Sourcetree. But, it doesn't work.
To sum up, I put my Github username and useremail to my .gitconfig file, but I got message that I cannot be permitted accessing with account that I don't know about(I just can guess)
What should I do for solving that problem?
Thanks a lot
Upvotes: 2
Views: 2631
Reputation: 11
I was getting the same error because i was accessing two accounts. So this helped me,
Control Panel——>User Account and family Safety——>Manage Windows Credential——>edit github account
Change the username and password according to from which acount you downloaded the code to that.
Upvotes: 1
Reputation: 740
I know it's a too late to answer this, but I hope it would be helpful for someone in the future.
Cause I too faced this error when trying to give an open source PR in github.
As the error says, we don't have access to directly push our code to a open source repository, we are expected to push our code through Pull Requests.
Short answer
Fork the repository that you want to push the code to.
Make changes in the fork repository.
Push your code to remote fork.
Give Pull request from fork repository to original repository.
Note: This answer is only valid if you are getting 'access denied' when trying to push to someone else's repository.
Upvotes: 0
Reputation: 71
The problem comes from Windows Credential Manager, and you just need delete the git account int the Windows Credential.I think it will work.
Control Panel——>User Account and family Safety——>Manage Windows Credential——>remove the github account
Upvotes: 1