I started experiencing this issue on Visual Studio Code in Ubuntu 20.04 yesterday.
I did not make any changes to my GitHub credentials, neither did I change anything in the project, but I run any git command to communicate with my remote branch like:
git pull origin dev
I get the error below:
remote: Repository not found.
fatal: Authentication failed for 'https://github.com/MyUsername/my-project.git/'
Here's what worked for me:
I tried recloning the project and then running the git pull command but it did not work.
git clone https://my-git-url
I tried setting my credentials again using the below commands but still no luck:
git config --global user.email "email@example.com"
git config --global user.name "John King"
I tried removing the remote repository and re-adding it using the below commands, but still no luck:
git remote remove origin
git remote add origin https://my-git-url
Finally, I decided to try using my default Ubuntu terminal and it worked fine. My big guess is that it's a bug from Visual Studio Code from the last update that was made some few hours before then (See the screenshot that shows that a Release was done on the same day that I was having the issue). I mean I set up Visual Studio Code using snap
, so probably it might have been updated in the background a few hours before then.
Hopefully, they will get it fixed and git remote operations will be fine again.