Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Duplicating a git repo into another organization

Git newbie question. I have two organizations setup, and would like to duplicate/copy a repository from one organizations into another. What would be the steps for that ?

like image 532
HIT_girl Avatar asked Sep 20 '25 02:09

HIT_girl


1 Answers

Consider testRepo is repo name under some org or user sampleOrg

so your git url will be https://github.rackspace.com/sampleOrg/testRepo

step 1. create repo with same name under other org, where u need to duplicate.

   eg: `https://github.rackspace.com/sampleOrgMirror/testRepo`

step 2. run: git clone --bare https://github.com/sampleOrg/testRepo.git

step 3: run: cd testRepo.git

step 4: run: git push --mirror https://github.com/sampleOrgMirror/testRepo.git

step 5: run: cd ..

step 6: run: rm -rf testRepo.git

now your code available in https://github.com/sampleOrgMirror/testRepo.git

you can follow link for more details https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/duplicating-a-repository

like image 197
Khazi Afzal Avatar answered Sep 23 '25 09:09

Khazi Afzal