I'm trying to do a simple git clone https://github.com/org/project.git
on a CentOS box but get:
error: The requested URL returned error: 401 while accessing https://github.com/org/project.git/info/refs
fatal: HTTP request failed
It never prompts me for my username/password, just fails.
I can make the exact same call on my Mac no problem- what am I missing?
If you have a problem cloning a repository, or using it once it has been created, check the following: Ensure that the user has gone through initial GitCentric login and has the correct username, email, and ssh. This should return a usage message that refers to the config-branch, config-repo, and ls-repo commands.
The answer was simple but not obvious:
Instead of:
git clone https://github.com/org/project.git
do:
git clone https://[email protected]/org/project.git
or (insecure)
git clone https://username:[email protected]/org/project.git
(Note that in the later case, your password will may be visible by other users on your machine by running ps u -u $you
and will appear cleartext in your shell's history by default)
All 3 ways work on my Mac, but only the last 2 worked on the remote Linux box. (Thinking back on this, it's probably because I had a global git username set up on my Mac, whereas on the remote box I did not? That might have been the case, but the lack of prompt for a username tripped me up... )
Haven't seen this documented anywhere, so here it is.
You can manual disable ssl verfiy, and try again. :)
git config --global http.sslverify false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With