How to Duplicating a repository?

rukonpro profile

Rukon Uddin

08/25/2024

How to Duplicating a repository?

Git:


1. Clone the Repository:

git clone <repository_url>


This creates a local copy of the repository on your machine.



2. Change Directory into the Cloned Repository:


cd <repository_directory>


3. (Optional) Rename the Remote (if you want to push changes to a new repository):


git remote rename origin upstream


4. Create a New Repository (Optional):


  • If you want to create a new repository on GitHub or another Git hosting service, create an empty repository.
  • If you’re using a different service, follow its instructions for creating a new repository.


5. Add a New Remote (if you created a new repository):


git remote add origin <new_repository_url>


6. Push to the New Repository (if you created a new repository):


git push -u origin master