-3

I'm having trouble mirroring my repository. The following commands works:

git clone --bare https://github.com/my_username/my-repo.git
cd my-repo

There is another repository which is empty that I want mirrored. That repository is owned by another person but I have access to it as I can see it in my GitHub account.

When I execute the following command, I get an error:

git push --mirror https://github.com/their-username/their-repo

remote: Repository not found.
fatal: repository ‘https://github.com/their-username/their-repo/’ not found

Repositories:

  1. https://github.com/my-username/my-repo (This is my repo which has my username)
  2. https://github.com/their-username/their-repo (This is their repo which has their username)

I am trying to mirror 1 into 2. I can successfully clone both repositories

alex
  • 1
  • 3
  • Does this answer your question? [How to mirror a git repository safely?](https://stackoverflow.com/questions/16003037/how-to-mirror-a-git-repository-safely) – Daniel Mann Apr 19 '21 at 17:56

2 Answers2

0

Git has mirror functionality built right into it

From your repo

git push --mirror https://github.com/their-username/their-repo

Note that this will completely overwrite their repo so you should make sure that they are OK with this.

Joe
  • 399
  • 2
  • 7
  • Thanks but I already know that I need to use the mirror command. The problem is I don't know why I'm getting an error when I use it. – alex Apr 19 '21 at 18:05
-1

The answer is:

I had read-only access and not read-write access. I emailed my organistaion and they changed this and it worked.

alex
  • 1
  • 3