0

I had already cloned a few repos from gitlab and then LATER we added two factor authentication on the gitlab repos.

Now I am trying to update my local branch by doing git pull like this:

sudo git pull

but I get an access error like this:

git@gitlab.com: Permission denied (publickey,keyboard-interactive).
fatal: Could not read from remote repository.

I have created an access token as the gitlab page describes but I am never prompted to use to add my username and access token, it simply says the error message above. How do authenticate my requests?

torek
  • 448,244
  • 59
  • 642
  • 775
KZiovas
  • 3,491
  • 3
  • 26
  • 47
  • Are you looking for [this kind of information](https://stackoverflow.com/a/67534214/86072) ? – LeGEC Nov 12 '21 at 12:06
  • or : to update the url of your `origin` remote : `git remote set-url origin ` – LeGEC Nov 12 '21 at 12:07
  • https://stackoverflow.com/a/34917354/7976758 Replace "clone" with "pull". Better: do not use `sudo`, I'm pretty sure you don't need it. – phd Nov 12 '21 at 12:29

1 Answers1

0

I found that I had to specify that I want to use http not ssh so when I used this it asked me for my username and token and it worked.

I had to add this:

 git pull origin-http
KZiovas
  • 3,491
  • 3
  • 26
  • 47