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
git remote add origin git-url-of-the-new-repo-you-created git push -u origin master
But be warned: This loses the link to the original repository, so if the original is still being developed on, the copy won't show "This branch is # commits behind repo-you-want-to-copy:master."