Migrate repository from github to local filesystem?
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?
2 Solutions collect form web for “Migrate repository from github to local filesystem?”
First, create your new repository by cloning your github repository:
git clone --bare email@example.com:<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:
Finally, on all other clones of the github repository, change the url of origin:
git remote set-url origin <new url>
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.
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.