简体   繁体   中英

Github Duplicating a repository: fixing remote: Repository not found

I am following the following process to duplicate a repository found here:

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

  1. Create a new private repository (new-repository.git) on github made sure not to create a readme - Done
  2. Create a bare clone of the public repository (old-repository.git) I want to duplicate by running

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

Success.

  1. Then I do this:

cd old-repository.git

And this:

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

I then get the error in my terminal that:

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

I seems like I am missing a simple step. How can I find out what is going wrong and fix it.

Add a new remote to your old repository and push your source to new remote repository.

$ 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 

Had the same problem.

Create a new repo in the destination location before you try to push to it.

Don't initialize it with a readme, just create.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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