Skip to content

Instantly share code, notes, and snippets.

@micolous
Last active September 21, 2019 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micolous/3c12bb2499fbc78b897df9b4840db4c9 to your computer and use it in GitHub Desktop.
Save micolous/3c12bb2499fbc78b897df9b4840db4c9 to your computer and use it in GitHub Desktop.
Promoting personal GitHub repositories to an organisation

Promoting personal GitHub repositories to an organisation account

When a project gets big, it makes sense to "promote" the repository to an organisation account.

The nice thing about transferring a repository is that GitHub automatically creates redirects for you.

But the problem is for the project's creator -- they should create their own fork of the repository to send pull requests. GitHub doesn't prompt you for a repository name, so this will remove all those redirects created earlier.

These instructions presume:

  • you have a GitHub repository named example, which is public
  • your account is A
  • your target organisation is B, and you have repository modification rights
  • you have repository modification rights on another organisation C, which does not contain a repository named example, or another fork of it. Make sure only you have permission to this organisation.

Promoting the project (the "wrong way")

  1. Transfer A/example to B/example.

  2. Create a fork of B/example in your account (which is created as A/example).

At this point, redirects are broken. :(

Fixing the redirects

  1. Rename A/example to A/example-working-copy (or some other name). It must be different to the main repository.

  2. Transfer A/example-working-copy to C/example-working-copy.

  3. Transfer B/example to A/example.

  4. Transfer A/example to B/example again. This will create new redirects at A/example to B/example.

  5. Transfer C/example-working-copy to A/example-working-copy.

  6. (optional) Create a repository C/example-working-copy and then delete it. This will destroy the redirects created from C/example-working-copy to A/example-working-copy.

At this point, A/example should redirect to B/example again!

Promoting a project without breaking redirects

  1. Transfer A/example to B/example.

  2. Create a fork of B/example in C.

  3. Rename C/example to C/example-working-copy (or some other name).

  4. Transfer C/example-working-copy to A/example-working-copy.

  5. (optional) Create a repository C/example-working-copy and then delete it. This will destroy the redirects created from C/example-working-copy to A/example-working-copy.

At this point, A/example should redirect to B/example, and you still have your own fork of B/example to work with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment