Old-school cloning over HTTPS of private repo #23677
-
Hi. I have not had to do this for some time, but the need has arisen. I need to clone a (new) private repo using just HTTPS: . When I do this, I get an error message that I’ve not seen before:
This is on a Mac running El Capitan with git from Xcode for El Capitan. Just for completeness, I also seem to get anomalous results when I do this (note it doesn’t as for credentials):
and:
(Obviously I’ve masked the password.) Any ideas what’s going wrong here? I can’t use SSH on this machine for non-technical reasons and I don’t have 2FA enabled as far as I can see. Thanks very much for any help. |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments
-
The documentation on Cloning with HTTPS URLs has been stating this for a while:
Does it work if you use a PAT instead of your password? |
Beta Was this translation helpful? Give feedback.
-
Thanks. Unfortunately, that seems to have uncovered a second issue. Note the error message here:
Here’s the message with an invalid PAT:
And just for completeness again:
Is GitHub possibly allowing me to create a private repo but not clone it? This is a personal (free) account being used here to share an example of some old work with another single entity. To my recollection, in the old days GitHub didn’t allow one to create a private repo on a free account. Thanks for any insights. |
Beta Was this translation helpful? Give feedback.
-
Hm, the only reason I can think of would be that the PAT lacks the
hangarr:
I remember that was the case, but that’s changed, see GitHub Free for user accounts. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your assistance. What you’ve suggested makes perfect sense but it appears there may be some other problem with GitHub and private repos. Although I’m sure I gave the first PAT repo scope, just to confirm I created a second with (only) repo scope and got the same failure: Perhaps this needs to be brought to the attention of some team at GitHub? Any ideas how to do that? Thanks again for your assistance. |
Beta Was this translation helpful? Give feedback.
-
hangarr:
I just noticed one more thing: The user account you’re using for authentication and the one owning the repository aren’t the same. Does the former actually have access to the private repository?
hangarr:
There are some Github people on this forum, I would hope one of them sees this. I’ve moved this thread to the #how-to-use-git-and-github section to hopefully make that easier. 😉 Or you could try the contact form: https://support.github.com/request |
Beta Was this translation helpful? Give feedback.
-
Thanks very much for the additional thoughts. You caught something that also has been an unanswered question for me. This repo was created sometime ago with the user name “hangarr” that corresponds to an email account “hangarr@yyyyy.com” on a domain yyyyy.com I own. I made that email account the secondary email account on this GitHub account. I added a public account hangarr09 account as the primary email account. I can log in with both email addresses for some reason. That has turned out to be convenient if puzzling. Just to be safe, I tried adding both accounts as collaborators on the repo and this went through without a hiccup by Github but without any notification to either email account. I can’t seem to find a list of collaborators on this repo but I probably don’t know where to look these days. I get the same error message trying both with one difference:
Notice the first asks for a password and the second gives up (immediately). I’m assuming the first at least is getting through authentication and the second is saying that the actual repo “username” is not a valid for cloning the private repo. Thanks also for explaining how GitHub folks monitor the communities and for moving this to the correct section. I appreciate your efforts on this. |
Beta Was this translation helpful? Give feedback.
-
I don’t think “hangarr09” is an actual GitHub usename as it is not found when searched for on GitHub. Cloning a private repository using a correctly scoped PAT definitely works when the user have read access to the repository if the repository is owned by th user doing the clone you definetly have pwrmiasions. Easily checked by using the the gui and and accessing the repository, you can also copy the clone URL format |
Beta Was this translation helpful? Give feedback.
-
Thanks very much for your response and the additional info. You’re correct there is a primary and secondary email associated with this Github account. I can login on the website with the username or either email account name. While that is a good thing, it turns out it confused me. Your clarification that I can only clone with the username was the key. When I used the username with a PAT it worked. Thanks both of you for your help. |
Beta Was this translation helpful? Give feedback.
-
@hangarr, glad you are working now, you can mark the answer as a solution if this is now solved |
Beta Was this translation helpful? Give feedback.
I don’t think “hangarr09” is an actual GitHub usename as it is not found when searched for on GitHub.
A user “hangarr” is found.
Your write up is a little confusing, but perhaps you have two emails registered on single github account username “hangarr09”.
So firstly the clone must use an actual GitHub username.
Cloning a private repository using a correctly scoped PAT definitely works when the user have read access to the repository if the repository is owned by th user doing the clone you definetly have pwrmiasions. Easily checked by using the the gui and and accessing the repository, you can also copy the clone URL format
So setting up a correctly scoped Pat on this user and uisbg it fo…