繁体   English   中英

Github 复制存储库:修复远程:未找到存储库

[英]Github Duplicating a repository: fixing remote: Repository not found

我正在按照以下过程复制此处找到的存储库:

https://help.github.com/articles/duplicating-a-repository/

  1. 在 github 上创建一个新的私有存储库 (new-repository.git) 确保不要创建自述文件 - 完成
  2. 创建我想通过运行复制的公共存储库 (old-repository.git) 的裸克隆

git clone --bare https://github.com/exampleuser/old-repository.git

成功。

  1. 然后我这样做:

cd old-repository.git

和这个:

git push --mirror https://github.com/exampleuser/new-repository.git

然后我在我的终端中得到错误:

remote: Repository not found.
fatal: repository 'https://github.com/exampleuser/new-repository.git/' not found

我好像错过了一个简单的步骤。 我怎样才能找出问题所在并修复它。

将一个新的远程仓库添加到您的旧仓库,并将您的源代码推送到新的远程仓库。

$ cd old-repository
$ git remote add newremote https://github.com/exampleuser/new-repository.git

#pushes specific branch to remote
$ git push newremote some-branch-name

#pushes all branches to remote
$ git push newremote '*:*'

#pushes all tags to remote 
$ git push newremote --follow-tags 

有同样的问题。

在尝试推送到目标位置之前,在目标位置创建一个新的存储库。

不要用自述文件初始化它,只需创建。

然后重试 git push --mirror https://github.com/exampleuser/new-repository.git

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM