I have a git repository on github.
I would like to migrate the master version of the repository to a local filesystem, and clone from this local filesystem copy.
How do I do so?
I have a git repository on github.
I would like to migrate the master version of the repository to a local filesystem, and clone from this local filesystem copy.
How do I do so?
There is no "master" repository when using Git, so all you need to do is git clone
the one from Github, and then clone from your local repository.
Of course you can't instruct Github to pull from your local repository, so you will still need to use git push
to push any changes to Github. However, doing so doesn't make the Github repository any more authoritative than your local one.
When you git clone
a repository, Git sets up the "origin" remote (see git remote
) to point to the repository you just cloned from. So, if you have a github repository G, and clone to a local repository A, then clone A to another repository B, then B's "origin" will point to A, not to G.
You can always change what the "origin" points to using the git remote
command.
First, create your new repository by cloning your github repository:
git clone --bare [email protected]:<User Name>/<Project Name>.git
If you want to delete your github repository, go to https://github.com/<User Name>/<Project Name>/edit
. At the bottom of the page, there is link to delete the repository.
Then setup your new repository to be shared:
http://www.google.com/search?q=serving+a+git+repository
Finally, on all other clones of the github repository, change the url of origin:
git remote set-url origin <new url>