C_Angell
C_Angell

Reputation: 23

Best method for cloning a github repository to another github repository

I'm new to git and GitHub so sorry if this question is simplistic. A vendor has developed the WordPress theme for our website and has created GitHub repo of the theme. We want to clone the theme to our an organization which has been set up on our enterprise GitHub account. However, I'm not quite understanding the process for the process for doing this. When I search cloning it's the answer always is discusses cloning from a GitHub repo to a local repo, whereas we want to clone from a private GitHub repo to a repo in the setup in our organization.

Upvotes: 2

Views: 1303

Answers (2)

VonC
VonC

Reputation: 1328742

Transferring a repo would mean you are the owner of the original repo.

If you are not the owner of that vendor theme repository, you do have to clone it locally, and then:

  • change its remote to refer to a new empty repo created in your GitHub organisation
  • push everything

That is:

git clone --mirror [email protected]:user/repo.git
cd repo.git
git remote set-url origin [email protected]:org/empty-repo.git
git push --mirror

Upvotes: 1

Mohamed Anees A
Mohamed Anees A

Reputation: 4611

In this case,I guess you need to transfer the ownership of the repo. You can refer this

https://help.github.com/articles/transferring-a-repository/

Hope this helps!

EDIT 1:If you just need a copy of the original repo (Note: further changes in original repo will not reflect in yours unless you do a pull after forking it)

https://help.github.com/articles/fork-a-repo/

Upvotes: 0

Related Questions