...
- Create an upstream repo in the organization; example:
gpii/nexus
- Important: Make sure this upstream repo is initialized with a placeholder README.md, or it will not be cloneable and forkable with the steps below.
- On GitHub, rename the original repo to avoid confusion with the upstream repo, and to enable clean forking of the new upstream repo
- For example, rename
simonbates/nexus
tosimonbates/simon-nexus
- For example, rename
- Delete any local clones of the origin repo (or rename and update the
origin
remote – any local clones will still point to the previous GitHub repo URL) - On GitHub, fork the upstream repo
- For example, fork
gpii/nexus
tosimonbates/nexus
- For example, fork
- Clone the fork onto your computer
- For example,
simonbates/nexus
- For example,
- Add the original repo as a remote in the cloned fork
- For example, in the local clone of
simonbates/nexus
, addsimonbates/simon-nexus
as a remote
- For example, in the local clone of
- Merge the work from the original repo into the new clone
- For example, in the local clone of
simonbates/nexus
, mergesimon-nexus/master
- When mering merging, add the
--allow-unrelated-histories
flag if you are using git version 2.9 or later. Otherwise you will get an error message on "refusing to merge unrelated histories".
- For example, in the local clone of
- Things to check that may need updating:
- Repo references in package.json or license statements - these should be updated to be references to the new organizational repo
- Push the changes from the local clone up to GitHub and make a pull request
...