I have some rails code that is hosted on a private github repo however I want to move that code to my own git server and do away with github. I have a server and git setup already, however if I do a git clone (github location) wouldn't that still be using github as a remote? What is the proper way to do this?
Asked
Active
Viewed 222 times
1 Answers
2
A git clone is a complete copy of the remote repository.
You can use git clone --mirror
on your private server, in order to set up an exact mirror of the remote, followed by git remote rm origin
to remove references to the original (however this is not necessary for it to function properly).
After this, all you have to do is clone the repo from your new, private source, instead of github.
(You can also use git clone --bare
instead; Differences between --bare
and --mirror
are explained here).
-
Awesome would this handle branches as well? – HelloWorld Sep 30 '13 at 18:46
-
Yes, it clones *everything*, tags, branches, refs, you name it. – Sir Athos Sep 30 '13 at 18:47