Move git repository to another github user
Tech News/by /Tue Apr 02 2024
14

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:
- 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.
- 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:
- Transfer ownership of the repository (or have the client fork it).
- Change your git config to push to the new repository
- You're done.
Comments
No comment yet