【问题标题】:What is the url for a full github repo?完整的 github repo 的 url 是什么?
【发布时间】:2015-05-03 16:19:16
【问题描述】:

我正在尝试将我的整个 github 存储库克隆到一台新机器上。在网站上,网址如下所示:

https://github.com/MyName

但是,当我这样做时:

git clone https://github.com/MyName C:/Users/MyName/Documents/GitHub/

我明白了

>Cloning into GitHub 'C:/Users/MyName/Documents/GitHub/'
>fatal: repository 'https://github.com/MyName' not found

【问题讨论】:

  • 这是帐户的 URL,而不是存储库。
  • 去github上的repo看一下页面。它在那里......

标签: git github


【解决方案1】:

https://github.com/MyName 将是帐户的 URL,而不是存储库。例如,jQuery(公司)在https://github.com/jquery 有一个帐户。如果我尝试从该 URL 进行克隆,则会收到克隆错误:

git clone https://github.com/jquery
>>> Cloning into 'jquery'...
>>> fatal: repository 'https://github.com/jquery' not found

这很有意义 - 该 URL 不是存储库。

同时,如果我真的克隆了这个项目,https://github.com/jquery/jquery,它可以工作:

git clone https://github.com/jquery/jquery.git
>>> Cloning into 'jquery'...
>>> remote: Counting objects: 36035, done.
>>> remote: Compressing objects: 100% (91/91), done.
>>> remote: Total 36035 (delta 60), reused 0 (delta 0), pack-reused 35944
>>> Receiving objects: 100% (36035/36035), 21.72 MiB | 2.77 MiB/s, done.
>>> Resolving deltas: 100% (25434/25434), done.
>>> Checking connectivity... done.

如果您想克隆一个用户名下的所有存储库,则没有本地方法可以做到这一点。但是,clone-allgithub-clone 似乎适合作为可以为您执行此操作的工具。

您需要(手动或使用工具)执行的一般程序是:

  1. 获取包含组织/用户所有存储库的 URL 列表。
  2. 使用git clone克隆每个主题。

【讨论】:

  • 谢谢...这是有道理的。但我实际上确实想克隆该帐户 - 一切?有没有办法做到这一点?
【解决方案2】:
git clone https://github.com/username/reponame.git

这是正确的格式。

【讨论】:

    【解决方案3】:

    https://github.com/MyName 只是您帐户的网址

    您的帐户可以有多个存储库,每个存储库都有自己的 URL:

    要克隆特定的 repo,请使用类似

    git clone https://github.com/MyName/Repo3.git C:/Users/MyName/Documents/GitHub/Repo3
    

    【讨论】:

      猜你喜欢
      • 2015-03-10
      • 2020-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-02
      • 2022-11-25
      • 2013-04-16
      • 2018-08-17
      相关资源
      最近更新 更多