You can use Git to mirror an existing repository and push it to a new repository. Here’s how:
Clone the repository you want to mirror
In the CLI type git clone --bare https://gitreposerver.com/username/original-repo.git
.
Push the cloned repository to the new repository
-
Once the repo has been successfully cloned, change into the directory where the repository was cloned:
cd original-repo.git
-
Push the mirrored repository to the new repository:
git push --mirror https://gitreposerver.com/username/new-repo.git
-
Once you have successfully completed Step 3, now leave the directory of
original-repo
by typingcd ..
and then you can delete the directory by typingrm -rf original-repo
.