Reputation: 945
I am trying to clone a private repository using the Terminal, but it fails stating the following errors:
I can successfully clone the same repo using xCode & Source Tree. I've added & verified SSH key & tried HTTP & SSH but the clone fails in both cases.
What am I missing here?
Upvotes: 2
Views: 2328
Reputation: 945
After many attempts I've found the solution. When you have to clone a private directory, git clone command changes a bit. Usually what we do is
git clone https://github.com/zzzubair/TestGit.git
which is fine if TestGit is public repository. But for private repository you've to mention your user name, which has right access to clone the repository, so this command changes to this.
git clone https://[email protected]/zzzubair/TestGit.git
I hope this'll help many others who are or will face the issue.
Upvotes: 3
Reputation: 1048
If you're using github and windows, verify that you generate your personal access tokens (more info here) and select the "repo" option (Full control of private repositories). Else, your token will be useful for public repositories.
Upvotes: 0