One of the best parts of GitHub is forking. See a repository that you want to use or modify? Just fork it and you’ve got your own copy to play around with.
However, GitHub will only let you clone a repo once. You can’t fork your own repos either.
So, if I wanted to create a new project starting with my derptype boilerplate, I’d have to initialize a new repo on my machine, create a gh-pages branch, download / unzip / copy over the html/css files, and deploy it back to GitHub. That’s a lot of work just to create a copy of my own code.
There are a few advantages of cloning vs. creating a new repo & copying over the source files:
- Mirror creates 1:1 copies, including branches, git history, etc.
- Cloned repos aren’t linked to a remote head / upstream.
- You can fork a repo as many times as as you want.
- Mirror can create new repos on the fly.
- You can clone a repo with a short 1 liner from the console.
I used Mirror to clone derptype2 from my original derptype repo —
mirror nealrs/derptype to nealrs/derptype2 -c
FYI, to use this compact form of the CLI, you have to create a personal GitHub token with repo permissions and set a couple environment variables. Otherwise, you must specify
-t params every time. Not a big deal, but I’m just saying.