Push prompting login

I was recently informed by Github that my personal access token needs regeneration.
I clicked the link provided in the mail and it appeared to be successful. I copied the token they gave me and told me tha I won’t be seeing it again.
I do not know what am I supposed to with that token.
However the first time I tried to push something after that I was prompted to enter my login credentials. I never used that before. I have my ssh key. And login and password I enter when I get prompted are invalid.
Does anyone know how to resolve this?

Most likely your system has the old token cached somewhere, which is now invalid. You’ll need to replace it with the regenerated version. How to do that depends on the software and system you are using.

Note that if you want to use SSH for Git access instead of HTTPS you need to update the URL for the remote repository.

I use windows 10. Usually git bash as a terminal, but sometimes integrated vscode terminal.
For one of my repos I changed the URL of the remote repo by going to .git folder, and then config file. It worked for that repo. Is this a bad practice? Will I have to do this for all repos I am actively working on?

Using git remote set-url might be a little safer (as in, avoiding mistakes), but editing the config file isn’t wrong.

Repository URLs (which define the protocol to use) are per-repository, so yes.

1 Like

O yeah, definitely safer and easier doing it through terminal. THANKS!

1 Like