Duplicating a repository through github's interface #123235
-
Select Topic AreaQuestion BodyIs there a way to duplicate a repo on github through its interface? I have a repo I use for prototypes, and once the prototype has matured I want to have it in its own repo. For my case it would just be easier to duplicate the original repo and delete and what I don't want afterwards. I know that I can just clone the repo, and push it to the new one, but I was wondering if there was a simple way through the UI. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
No direct duplicate function on GitHub's interface, but two options:
|
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
While GitHub doesn't have a literal "Duplicate" button for standard repositories, you are completely right that doing this through the UI is much easier than doing the whole clone/change-remote/push dance in the terminal. Depending on whether you want to keep your prototype's commit history or start with a clean slate, there are two simple ways to duplicate a repository entirely through the GitHub web interface. Method 1: The "Import" Tool (Keeps Commit History)This is the closest thing to a true duplication because it clones the exact state of the repository, including every single commit you made while building the prototype.
Note: If your prototype repository is private, GitHub will prompt you for your credentials. You will need to use a Personal Access Token (PAT) as the password to authorize the import. Method 2: The "Template" Feature (Clean Commit History)If your prototype phase involved a lot of messy, trial-and-error commits that you don't want to carry over to the mature project, you can use the template feature. This copies all your files and directory structures exactly as they are, but gives you a brand new, clean commit history.
Once your repo is duplicated using either method, you can jump right into the new repository's UI, delete the files or folders you don't need for the mature version, and you're good to go! Once you are done, you can also uncheck the "Template repository" box in your original repo if you used the second method. |
Beta Was this translation helpful? Give feedback.
No direct duplicate function on GitHub's interface, but two options:
Forking (Faster):
Clone & Push (More Control):
git clone <URL>.cd).git initif needed).git add .).git commit -m "Initial commit").git push origin main).