This issue happened suddenly on my Git environment integrated with IntelliJ Ultimate. While investigating this, I made things even worse and Git was totally denied including using SSH.
Along the way, I also tried Two Factor authentication on GitHub, and eventually got that to work both in IntelliJ and also with SourceTree.
The following sequence of events finally have fixed the issue.
If You've Tried These Already, then You Have the Same Problem as I Had.
- Instead of trying https://gihub.com...
youtried https://email@example.com... Note that this would not work if your Windows Credentials already has cached your user name and password.
- You tried to change to the SSH URL
- You've even tried to generate a new SSH key
- You've even loaded the SSH key via pagent.exe
- Note that SSH issue is a separate issue, so in this article I will stick with getting you back up and going with
https(including using the Two-Factor authentication.)
1. Check the Windows Credentials to Remove Any Git Related
- Open the Start menu and type in "Credential Manager" This will open the Windows Credential Manager. This is basically the same thing as "Mac OS Keychain" in fact, if you are on the Mac, you would want to check there. Check and remove all Git related credentials, this is the most likely cause if you see https:// Repository not Found issue.
- Now try your Git access and see this will issue a new username and password prompt.
2. Last Resort: Completely Remove Your Git and
it Directly Re-Install
- Be sure you have done Step 1.
- For this does not use chocolaty. If you did already, first try the uninstall via "
uninstall git". choco
- Go to the Program and Features and remove any installations of Git
- Go to C:\Program Files\Git or likewise and manually delete all remnants of Git
- Download and install from the Git Web Site.
- Check your~/
. file to make sure nothing strange is there. Also, I would check in your local Git repos gitconfig ./ . git/config file for URLs pointing to the repo. (Note, you can type in ~ if you are using PowerShell, if anything else, that's one big attraction of using PowerShell to be able to cd to ~/Downloads and ~/Desktop) cd it a shot I will post an article about PowerShell Essential Survival Guide next. give