0

The first time I pulled a repo from github I used the following command

git pull https://<username>:<password>@github.com/<repo>

Then I would just type git pull and the repo updates automatically

In the last few days, I have been getting messages regarding removing the ability to use passwords to push or pull repos, and instead to generate a personal token

Now although I connected successfully using the new personal token, the old password I used for git pull is still cached and gives me the error authentication failed

How can I reset the cached git pull password?

On mac, the push command was reset successfully with git config --global push.default simple but on ubuntu the pull command is refusing to reset and is always cached to the old authentication unless I specifically put in the new username and password

torek
  • 448,244
  • 59
  • 642
  • 775
Hadi
  • 705
  • 8
  • 23
  • have a look at your remote url with `git remote -v`, maybe you have to change it there – Turo Feb 24 '21 at 14:44
  • It's probably easiest to remove the remote and add it back using `git@github.com` instead of https. You can probably edit the url, but blowing it away seems reasonable. Or just create a new remote with a different name. – William Pursell Feb 24 '21 at 14:57

1 Answers1

0

Most people come at this problem from the opposite direction: they'd like Git to start caching their password. Hence the first several duplicates that I have found have the instructions reversed, as it were:

The most relevant are these:

The last one is the right place to look, but note that many answers are specific to Windows, including the accepted answer. This answer from irbanana is useful but I recommend that you read through all the answers, so as to learn how Git itself doesn't do anything about passwords. Instead, it fobs that job off to some other program. ("Fob off" here is meant somewhat tongue-in-cheek, since those other programs are far better at this than Git could possibly be.)

torek
  • 448,244
  • 59
  • 642
  • 775