This blog is modified from moose-horizons
How to copy a GitHub repo without forking
GitHub only lets you fork a repo once, if you want to make more than one copy of a project here’s how you can do it. Useful for starter code.
-
Create a new empty folder for your project and initialize git
$ cd where-you-keep-your-projects $ mkdir your-project-name $ cd your-project-name $ git init -
“Pull” the repo you want to copy:
# git url is the same as the clone URL $ git pull git-url-of-the-repo-you-want-to-copy - Create a new repository for your project on GitHub
-
Push your code to the new repository you just created (Push an existing repository from the command line)
$ git remote add origin git-url-of-the-new-repo-you-created $ git branch -M main $ git push -u origin main