Migrate repository from github to local filesystem?

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 Git or SVN handle large binary files
  • Git refs/remotes/origin/master does not point to a valid object
  • Undoing git reset?
  • Why doesn't git allow me to safely delete a branch?
  • What are the ethics & etiquette of forking someone else's github project to release it as a gem?
  • How to “resolve fatal: Not a git repository”?
  • How do I do so?

  • What is the difference between `git reset --hard head` vs `git clean --force -d ` vs `git checkout — .` to discard local changes
  • Git repository transfer
  • Make linear master branch git
  • Collaborative Coded UI tests
  • Best tooling/methodology to work with a git client and an SVN repository
  • Restrict read access in git repo using gitolite
  • 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 git@github.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:

    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>
    

    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.

    Git Baby is a git and github fan, let's start git clone.