This post explains how to create an independent copy of a GitHub repository with no connection to the original repository.
Clone and push to a new repository
To create an independent copy of a GitHub repository, you can follow these steps:
-
Clone the original repository: Use the
git clonecommand to clone the original repository to your local machine.git clone https://github.com/LearnWithLlew/TestingBetterWithApprovals.Java.git cd repo -
Remove the existing remote reference to the original repository:
git remote remove origin - Create a new repository on GitHub: Go to GitHub and create a new repository.
-
Add the new repository as a remote: Use the
git remote addcommand to add the new repository as a remote.git remote add origin https://github.com/ibanFR/testing-better-with-approvals.git -
Push the code to the new repository: Use the
git pushcommand to push the code to the new repository.git push -u origin main