Move git repository to another github user

Any of the following will work:

  • Just transfer ownership of the repo to another user and have them add you as a collaborator.

  • If someone forks your repo, then you delete the original, their fork is still there, unless it's a private repository. they can then add you as a collaborator on their fork repo.

  • Another user can simply clone your repo (commits intact), create a new repo on GitHub, add the new repo's remote info, and push your repo up to their new one. (Then, they can add you as a collaborator.)


To answer the questions:

  1. You would not lose anything - not even commit history. The point of Git is that it is decentralized - everybody with a copy of the repository has everything. Just the new repo.

  2. It is easy to change the git settings to push to the new repository. You can either use

    git remote set-url origin git://new.url.here
    

    or edit the .git/config file.

I would say you should:

  1. Transfer ownership of the repository (or have the client fork it).
  2. Change your git config to push to the new repository
  3. You're done.