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/refsfatal: 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?
The answer was simple but not obvious:
Instead of:
do:
or (insecure)
(Note that in the later case, your password will may be visible by other users on your machine by running
ps u -u $youand 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.