While trying to push something to Github, I encountered repository not found/operation timed out errors.
I had slightly different errors on VS Code and my regular terminal.
on VS Code
remote: Repository not found. fatal: repository 'https://github.com/user/repo.git/' not found
On my regular terminal
fatal: unable to access 'https://github.com/user/repo.git/: Failed to connect to github.com port 443: Operation timed out.
How to fix it.
From what I noticed, this issue seems to be caused if you are using more than 1 Github account. So the key chain gets messed up.
To fix this issue
- Open up Spotlight search (command + spacebar) and search for “Keychain Access”.
- In here, search for “github”. Delete everything related to github.
- Completely quit VS Code or your terminal (depending on what you use).
git push origin master(or whatever you use) should now ask you to log in, and it should work.
That should fix it.
I hope this helps.