I'm on a machine running Windows 10, with Developer Mode enabled and the Linux Subsystem installed. When I switch into bash, I am trying to run a simple clone command from git:
git clone Of course I've scrubbed the URL here a bit, but you get the idea. Initially, the response I got back from that command was this:
fatal: unable to access '': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
I saw a few Stack Overflow answers talking about that but to be honest I don't really know the proper way to deal with that error. With that said, I know an improper way which is to just circumvent it completely, by running the following command:
git config --global http.sslverify falseAnd that seems to work. It's probably bad that I'm turning off all SSL verification, but I need to get this working, and it's not really the point of this question (which I'm getting to). But as an aside if you know the proper way to fix that I'm all ears.
Next, I re-ran my git clone command, and this time it prompted me for a username and password, but utlimately ended up failing for a different reason. Here's what it looked like:
git clone
Cloning into 'my-private-repo'...
Username for ' myuser
Password for '
remote: Invalid username or password.
fatal: Authentication failed for 'However, I can assure you that the username I typed was correct, as was the password. I also have Git for Windows installed, and when I tried it there everything worked. The only caveat was that instead of prompting me for a password in the command line, it opened a separate window to enter credentials and there it also asked me for my six-digit 2FA code. Then it cloned just fine. I noticed that in doing so it created a Personal Access Token in Github. So I went ahead and created another Personal Access Token, and tried to use it manually in bash. Basically instead of typing myuser for the username I typed myuser:mytoken
git clone
Cloning into 'my-private-repo'...
Username for ' myuser:a1abcdefab2a34567ab8901a2bc3d4567890a1b2
Password for '
remote: Invalid username or password.
fatal: Authentication failed for 'But as you can see it still failed. How do I get git working in bash on Windows?
12 Answers
You need to just use your user name and then instead of your password use your access token. You don't need your password as the token replaces it.
You are using the implementation of git on your currently running linux distribution, which you probably didn't set up.
try using git.exe instead:
git.exe clone You can alias the command in your .bashrc:
alias git='git.exe'