I
I
IliaMal2021-09-01 11:03:30
git
IliaMal, 2021-09-01 11:03:30

How to change git authentication from a password to a token if the password is not requested?

Hello.

When trying to pull fresh changes from GitHub, I came across an error

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authenticatio... for more information.


I created a new token, but in order to activate it, pgit would ask for a password when executing the command, but it does not ask for it.

There is an option to demolish the .git folder and re-initialize git, but then comets will be lost and you will have to pull the entire project from the repository.

What is the easiest way to replace the password with a token?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Kuznetsov, 2021-09-02
@IliaMal

Why doesn't it ask for a password? Because it's already saved in the password vault.
What should I do to ask for the password again? You need to delete the old password of course!
Passwords are stored differently in different operating systems, and therefore you were first asked to show the config git config -lin order to clarify the cleaning method.
But you can try the universal method for resetting authorization:

echo "url=https://github.com" | git credential reject

If you now try again git push, then a window for choosing the authorization method will pop up.

4
4goya, 2021-09-06
@4goya

It didn't work for me on Linux with a token. Everything worked fine via SSH.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question