Home Mirroring a Repository

Mirroring a Repository

I’m kind of in love with Jekyll at this point and am trying to learn more about it. The best method I’ve found is to analyze/use other templates until I understand the structure, then start taking them apart or building my own template. So I decided to fork a few templates. However, I like keeping certain repos private, which I can’t do if I fork them. So I tried mirroring instead.

The following is mostly for me and is based on this GitHub document.

How to Mirror a Repository

  1. Create a repository on GitHub. This will be the target for the mirror.
  2. Open Git Bash in a place you can temporarily create a git folder.
  3. Use the following command to create a bare copy of the repo.
    git clone --bare origin-url
  4. With Git Bash, cd into the .git folder before mirror pushing into the directory you made on GitHub:
    git push --mirror target-url
  5. Exit the directory and delete the temporary git folder made in step 3.