Updated: 22 October 2026 · Applies to: Error
In order to execute Git commands, you need to download Git Bash and install it. Once done,
Step 1: Launch Git Bash
Step 2: Let’s create a bare clone of the repository that you wish to duplicate
git clone --bare https://github.com/username/repo-you-wish-to-duplicate.git
Step 3: Duplicate a repository using mirror push command, to do that you need to change directory to the bare-cloned repository folder.
cd repo-you-wish-to-duplicate.git
Now, mirror or duplicate the repository using the below command.
git push --mirror https://github.com/username/duplicate-repository.git
That’s it! Go to your GitHub account and view the duplicate repository.
Step 4: Well, you don’t need the bare-cloned repository in the local machine, so just go ahead and delete it.
Do you see Repository not found error while pushing the code change? And now stucked, don't worry hire our admins they will help you to fix the issue.
A mirror clone is larger than a normal clone since it also copies every remote-tracking reference, so it is the right choice specifically when you need a faithful, pushable copy of a whole repository, not just its current working files.
After cloning with --mirror, pushing that mirror to a new remote with git push --mirror reproduces the original repository, including every branch and tag, at the new location.
Either method keeps the full commit history intact, which a plain file copy of a working directory would not.