MIRROR A GIT REPOSITORY
Step 1: Create an empty destination repository
Create an empty destination repository (without a README etc.).
Step 2: Clone the repository to mirror
This will create a directory with a .git
extension containing all the Git metadata.
git clone --bare https://github.com/EXAMPLE-USER/OLD-REPOSITORY.git
Step 3: Navigate to the the cloned repository
Step 4: Set the remote url to push to
git remote set-url --push origin https://github.com/EXAMPLE-USER/MIRRORED
Step 5: Fetch latest updates from source repository
Step 6: Push updates to destation repository
References
Mirroring a repository in another location