Issue
Windows 7 PC
- Installed Git (includes Git Bash console)
- Opened console and typed command to clone a Git repo.
- Got a warning to install .Net Framework, but wanted to install that later, so hit cancel and got the old school default username and password separate login popups (NOT the new Git Credentials popup)
- typed my user and password into the old school popups and it logged in and then properly cloned the repo to my local workspace
- Installed .NetFramework and restarted computer as necessary
- Opened Git Bash, tried to run a command that requires git login (git pull, git push, etc) and the command console freezes at that point. I would expect the new Git Credentials Manager popup to come up so I can login, but it never comes up. Neither does the old school login popup. Therefore, I cannot log in to Git, and so all actions requiring login cannot proceed.
I tried:
- restarting computer
- uninstalling and reinstalling git
- repairing .netframework
- looking for saved credentials (couldn't find anything). there should not be any saved credentials anyway since I used the old school authentication login which doesn't save them, AFAIK.
I've gone through all this before on another computer and didn't run into this. That time, after installing .netframework, when I tried a git command requiring login, the new Git Credentials Manager popped up (after which it then saved my credentials)
Searched Google and Stack Overflow / exchange etc and could not find this exact issue anywhere. Most questions were about how to stop the popup from showing and to save credentials, which is exactly the opposite issue of mine.
Note: Windows 7 should not be the issue because I've done this on a Win 7 PC without issue.
So, how do I Force a Git login popup to show up (either the new one or the old school one)?
I tried a variety of things, still can't get the new token authentication popup, but here's what I tried and where I'm at now:
I decided to look in Windows Programs area, and did not find Git Credential Manager, which is odd because it's included with Git and I just installed Git. Anyway, downloaded and installed the standalone git credentials manager.
Then tried these:
git config --global credential.helper manager-core
git config --global credential.helperselector.selected manager-core
and got:
warning: credential.helper has multiple values
(and I forget the other error lines but it said something about using --replace-all to fix)
so I did:
git config --global --replace-all credential.helper manager-core
and that gave no errors and seemed to do something
then I ran:
git config --global credential.helperselector.selected manager-core
Then I did git push, and it automatically pushed without asking my credentials at all, which is really confusing.
So, I have still failed to get the new Token Authentication popup. This is incredibly frustrating...
Since Git Push worked without asking for creds, I realized the popup I want may not be showing up because Windows Credential Manager may already have the creds I typed previously. So I went to Windows Credential Manager, found them, and removed them from the vault.
Then I tried git pull and I finally got the NEW Token Authentication popup. My hopes skyrocketed. I entered my Token. Then my hopes were crushed when the terminal gave the following errors:
fatal: An error occurred while sending the request.
fatal: The request was aborted: Could not create SSL/TLS secure channel.
Solution
I would expect the new Git Credentials Manager popup to come up so I can login, but it never comes up.
For that, you would need at least to instruct Git to use it:
git config --global credential.helper manager-core
git config --global credential.helperselector.selected manager-core
The OP adds:
It automatically pushed without asking my credentials at all, which is really confusing."
If you want to force it to ask you for your credentials (username+token), you need to clear the currently stored credentials first.
Example, assuming your remote is github.com
:
printf "protocol=https\nhost=github.com" | git-credential-manager-core erase
Repeat this command until you see a popup.
Do not enter your credentials then. Cancel the popup
Note: That git-credential-manager-core.exe
is in, for Windows, mingw64/libexec/git-core
of your Git installation.
So that needs to be in your %PATH%
for git-credential-manager-core erase
to work.
Then, try your push again: you will see a popup.
Enter your credentials: they will be stored.
Check that the right token is stored with:
printf "protocol=https\nhost=github.com\nusername=<you>" | git-credential-manager-core get
Regarding the error message:
fatal: The request was aborted:
Could not create SSL/TLS secure channel.
Check Unable to download some components due to TLS 1.2 only change.
That is because of GitHub's "Weak cryptographic standards removal notice".
Support for TLS 1.2 needs to be installed.
See "Support for TLS System Default Versions included in the .NET Framework 3.5.1 on Windows 7 SP1 and Server 2008 R2 SP1":
For 64-bis:
- install
windows6.1-kb3154518-x64.msu
- add the following registry keys, to use the operating system defaults for SSL and TLS instead of the hardcoded .NET Framework defaults.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v2.0.50727]
"SystemDefaultTlsVersions"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v2.0.50727]
"SystemDefaultTlsVersions"=dword:00000001
- reboot, and you are good to go.
Answered By - VonC Answer Checked By - Pedro (WPSolving Volunteer)