Reputation: 147
Might be a duplicate question, but none of the available solutions seems to be working. Could be that Github changed Support for password since 13 Aug, 2021.
I have tried the following:
The error message:
Username for 'https://github.com': gandharvsuri
Password for 'https://[email protected]':
remote: Permission to gandharvsuri/gandharvsuri.github.io.git denied to gandharvsuri.
fatal: unable to access 'https://github.com/gandharvsuri/gandharvsuri.github.io.git/': The requested URL returned error: 403
Upvotes: 11
Views: 127548
Reputation: 1
you'll be navigated to account setup page.
Upvotes: 0
Reputation: 1
Go to Control Panel\All Control Panel Items\Credential Manager>Windows Credentials
Next>> delete the existing git hub credential
next>> again run the command git push or push from your code environment.
next>> it will ask for authentication
next>> enter your credentials
that's it, it will be done.
Upvotes: 0
Reputation: 41
I found solution of this problem.
Sometimes, it is because of not being able to get proper credentials from Windows Credentials Manager.
If so,
Open Credential Manager by running the following at the command line:
control /name Microsoft.CredentialManager
Manage git credentials
Upvotes: 4
Reputation: 229
First you need to generate a new token.
My account - Setting - Developer Setting - Personal Access Token - Generate New Token
After you generate the token,
git remote set-url origin https://<token>@github.com/<username>/<repo>
For example,
git remote set-url origin https://ghp_
[email protected]/GitHubUser/AwesomeRepo
Upvotes: 21
Reputation: 9
ssh-keygen -t rsa -b 4096 -C "[email protected]"
git remote set-url origin [email protected]:/.git
ssh -T [email protected]
test ssh git remote set-url origin [email protected]:ragOP/vc.git
Upvotes: -1
Reputation: 1
provide an idea . make sure the ssh key was add into the github_account truely. then change the remote URL to the ssh ,the command following:
git remote set-url origin [email protected]://<Repositories.git>
Upvotes: 0
Reputation: 1
I found success doing this within my codespace by just setting up ssh keys to github. Essentially I just ran the following commands:
ssh-keygen
I then enter till the key was generated. Then changed into the directory to get the public key.
cd /home/codespace/.ssh
cat id_rsa.pub
I copied that and threw it under my profile for ssh keys. You may have to re clone down your repo using ssh after this but this is a good solution if your using multiple git repos within your codespace! I'm currently using my codespace for a class and whenever I'm not programming I turn it off to avoid going over my free 60 hours.
Upvotes: 0
Reputation: 21
I got the same error, I use the SSH e.g., [email protected]:Example/Name-Of-Repo.git, instead of the HTTPS.
Upvotes: 1
Reputation: 19
Try not pushing with VScode terminal or being signed in to a vscode account. Open a bash terminal/window and push from there. this worked for me.
Upvotes: 1
Reputation: 41
The solution for me was to make sure the git remote url was set properly:
git remote set-url origin <blabla.git>
After that, it worked like a charm...
Upvotes: -1
Reputation: 411
This worked for me
When creating your Personal Access Token, ✅Check some of the checkboxes e.g
Well this worked for me Try this
Upvotes: 37
Reputation: 155
I got the same error for https connection. When I clone repo with ssh the problem was fixed.
I followed this link to generate SSH key-pair.
After you done that step on the link above:
ssh -T [email protected]
You're ready to use SSH.
Now I used VSCode to clone my repo. You can follow anyother tool or terminal as well.
When the VSCode is opened, click to Clone Git Repository...
After that you can see the following:
Now here, you need to enter your repos' SSH connection:
Just copy and paste that link and your repo will be cloned with SSH protocol. Thus, you can use VSCode or Github Desktop to push or pull or for any other request without https (Autentication token).
Upvotes: 3