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 namedexample
, or another fork of it. Make sure only you have permission to this organisation.
-
Transfer
A/example
toB/example
. -
Create a fork of
B/example
in your account (which is created asA/example
).
At this point, redirects are broken. :(
-
Rename
A/example
toA/example-working-copy
(or some other name). It must be different to the main repository. -
Transfer
A/example-working-copy
toC/example-working-copy
. -
Transfer
B/example
toA/example
. -
Transfer
A/example
toB/example
again. This will create new redirects atA/example
toB/example
. -
Transfer
C/example-working-copy
toA/example-working-copy
. -
(optional) Create a repository
C/example-working-copy
and then delete it. This will destroy the redirects created fromC/example-working-copy
toA/example-working-copy
.
At this point, A/example
should redirect to B/example
again!
-
Transfer
A/example
toB/example
. -
Create a fork of
B/example
inC
. -
Rename
C/example
toC/example-working-copy
(or some other name). -
Transfer
C/example-working-copy
toA/example-working-copy
. -
(optional) Create a repository
C/example-working-copy
and then delete it. This will destroy the redirects created fromC/example-working-copy
toA/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.