Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcenirm/11263751 to your computer and use it in GitHub Desktop.
Save mcenirm/11263751 to your computer and use it in GitHub Desktop.
Mirroring a Git repostory
The firm I recently stated working at just moved to Git and I am the only resource then knows Git. I get asked so many times a day on how to mirror a git repostory.
From the birds eyes very its very easy:
git clone --mirror git@git.com:project project
cd project
git remote add github git@github.com:username/project.git
In cron Job
cd /pathto/project && git fetch -q && git push -q --mirror github
Thats how easy it is to mirror a Git Project on to GitHub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment