【问题标题】:How to I clone a GitHub repo and push it to Gitlab?如何克隆 GitHub 存储库并将其推送到 Gitlab?
【发布时间】:2021-10-21 01:51:18
【问题描述】:

我正在尝试克隆一个 github 存储库,使用:

$ git remote add upstream https://github.com/.......

但我得到了错误:

fatal: not a git repository (or any of the parent directories): .git

我使用的格式:

$ git remote add <choose a remoteID, not "origin">  <URL to GitLab/GitHub/Atlassian/BitBucket>

我尝试过使用实际的 repo ID:使用元内容中的字符串

<meta content="123456789" name="octolytics-dimension-repository_id" />

在本例中,存储库的 ID 为 123456789

【问题讨论】:

    标签: git github gitlab git-clone git-remote


    【解决方案1】:

    您是否在现有的仓库中?如果不只是使用 git clone 通常克隆 repo,例如git clone https://github.com/openwall/john.git

    您只能将遥控器添加到现有的本地仓库中,您必须在文件夹中执行 git init 以使其成为仓库,然后再添加遥控器,但我建议您使用上面的命令克隆它。

    【讨论】:

      猜你喜欢
      • 2022-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-04
      • 2020-09-21
      • 1970-01-01
      • 2021-12-31
      相关资源
      最近更新 更多