2

I tried to push / pull code from a private repository which I have access to and instead I get the error below:

remote: Repository not found.
fatal: Authentication failed for 'https://github.com/path-togit.git/'

I have searched and tried all solutions provided on different platforms, but none works. For example, deleting the vscodegithub entry in passwords and keys, but still it doesn’t work.

I tried the following but they do not work in my case:

I have seen that people reporting these as successful are Windows and Mac users. Is there a solution that works for Ubuntu?

P.S.: I can successfully push/pull using the normal terminal. My problem is with the Visual Studio Code terminal and my operating system is Ubuntu 20.04 (Focal Fossa).

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Kthree
  • 156
  • 1
  • 12
  • 1
    What is your `git config credential.helper`? – VonC Nov 15 '21 at 08:10
  • @VonC initially running that command did not return a response then somewhere along trying solutions I changed the cache timeout to 1 second so now when I run `git config credential.helper` i get `cache --timeout=1` – Kthree Nov 16 '21 at 06:06
  • 1
    What is your `git version`? And does the remote URL exist? (if you type that exact URL, do you get to your provaye repository?) – VonC Nov 16 '21 at 06:51
  • @VonC git version `git version 2.31.1` and yes remote URL exists . As mentioned in the question I can pull or push using the normal terminal . But I cant do so using the terminal in vs code . Vs code must have cached the wrong password when I switched repos sometime and I want it to forget those credentials so I can enter new ones – Kthree Nov 17 '21 at 19:45
  • 1
    OK. VSCode should be using the same credential helper than command-line though. I would install GCM-core (https://github.com/microsoft/Git-Credential-Manager-Core/#linux) and see if that caching works better with VSCode. – VonC Nov 17 '21 at 19:52
  • This is a super [FAQ](https://en.wikipedia.org/wiki/FAQ) (because it affects so many). A candidate for the canonical question is *[fatal: Authentication failed for](https://stackoverflow.com/questions/69979522/)* (despite the unspecific title). – Peter Mortensen Nov 17 '21 at 22:32

1 Answers1

2

I have managed to solve this with help by installing GCM-core (https://github.com/microsoft/Git-Credential-Manager-Core/#linux)

Kthree
  • 156
  • 1
  • 12