Tom Mango

Transferring a Private Repository on Github

Important Update (08-21-2011)

GitHub now has a native support for transferring the ownership of a repository to another user. Just click into your repository’s admin area and scroll down to the Danger Zone™.

Original Post (06-24-2010)

I recently had to transfer a private git repository that was being hosted on Github. It turned out to be embarrassingly easy to transfer the repository while keeping the history intact, but I figured I’d document it in case others were wondering.

What Didn’t Really Work

The first thing I tried was a fork. I added the receiver’s Github account as a collaborator to the private repository. Then, I forked the project on the receiver’s Github account. Afterwards, I removed the receiver as a collaborator from the original project and removed the original account as a collaborator on the newly forked project (which is automatically added by Github).

More or less, this did the job. The newly forked project was it’s own repository and neither repository owner could see the other repository. The only issue was that the new repository still said “forked from {original account}”. The receiver wasn’t happy about this and to be honest, it was a little crude being that they purchased the codebase.

The Correct Way

The correct way to do this is basically just as easy.

This isn’t rocket science, but I figured it would help someone.