This worked for me:
git clone https://username@github.com/username/repo_name
ID : 10321
viewed : 45
Tags : gitauthenticationgithubgit-cloneprivate-repositorygit
98
This worked for me:
git clone https://username@github.com/username/repo_name
86
Private clone URLs take the form git@github.com:username/repo.git
- perhaps you needed to use git@
rather than git://
?
git://
URLs are read only, and it looks like private repos do not allow this form of access.
73
I have met this issue several times and every time I landed on this page, tried every thing and failed!
It's because I have 2FA enabled!!!
According to https://help.github.com/articles/which-remote-url-should-i-use/#when-2fa-is-enabled
If you have enabled two-factor authentication, or if you are accessing an organization that uses SAML single sign-on, you must provide a personal access token instead of entering your password for HTTPS Git.
git clone https://github.com/username/repo_name.git
(The default git repo link is good enough!)Update:
git config credential.helper store
(don't do this on machine you don't trust)61
This worked for me:
git clone https://username:password@github.com/username/repo_name.git
57
For me the solution was:
git clone https://myusername@restoftherepolink.git
Here you need to be the owner of the repo but if you aren't then it will go as
git clone https://myusername@github.com/ownersusername/repo_name.git
If you have 2FA enabled
then:
git clone https://myusername@restoftherepolink.git