克隆私有存储库 (Github) [英] Clone A Private Repository (Github)
问题描述
我在 Github 上有一个用于我正在处理的项目的私有存储库.到目前为止,我只在家用台式机上工作过,但我刚买了一台笔记本电脑,我正在尝试对其进行设置,以便我可以在任何一台计算机上处理项目,并推送/拉取更改.
I have a private repository on Github for a project I'm working on. Until now I had only worked on my home desktop, but I just bought a laptop, and am trying to set it up so that I can work on the project from either computer, and push / pull changes.
我在笔记本电脑的 Github 帐户中添加了一个新的 SSH 密钥,并成功克隆并更改了我设置的公共测试存储库.但是,我无法克隆私人回购.为了克隆私有存储库,我需要在命令行中执行什么特殊操作吗?我是否需要为我的笔记本电脑设置一个新的 GitHub 帐户并将自己设置为协作者?
I added a new SSH key to my Github account for the laptop, and was successful in cloning and making changes to a public test repo that I set up. However, I couldn't clone the private repo. Is there anything special I need to do in the command line in order to clone a private repo? Do I need to set up a new GitHub account for my laptop and set myself up as a collaborator?
我使用的命令是git clone git://github.com/username/reponame.git
推荐答案
私有克隆 URL 采用 git@github.com:username/repo.git
的形式 - 也许你需要使用 git@
而不是 git://
?
Private clone URLs take the form git@github.com:username/repo.git
- perhaps you needed to use git@
rather than git://
?
git://
URL 是只读的,看起来私有仓库不允许这种形式的访问.
git://
URLs are read only, and it looks like private repos do not allow this form of access.
这篇关于克隆私有存储库 (Github)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!