|
| 1 | +.. ----------------------------------------------------------------------------- |
| 2 | + (c) Crown copyright Met Office. All rights reserved. |
| 3 | + The file LICENCE, distributed with this code, contains details of the terms |
| 4 | + under which the code may be used. |
| 5 | + ----------------------------------------------------------------------------- |
| 6 | +
|
| 7 | +.. _visibility_changes: |
| 8 | + |
| 9 | +Changing Fork Visibility |
| 10 | +======================== |
| 11 | + |
| 12 | +Technical Guide: Re-linking to a Public Repository |
| 13 | +-------------------------------------------------- |
| 14 | + |
| 15 | +Once the repository is public, contributors must re-establish their forks to continue submitting pull requests. |
| 16 | + |
| 17 | +#. Create a new public fork (you will need to delete or rename existing private fork)** |
| 18 | + 1. Navigate to the now public repository |
| 19 | + 2. Click the Fork button int the top-right corner to create a new fork under your account |
| 20 | + |
| 21 | +#. Update Local Remotes |
| 22 | + In your existing local clone, you must update your remote URLs to point to |
| 23 | + the new public upstream and your new fork. Use the following commands: |
| 24 | + |
| 25 | + .. code-block:: sh |
| 26 | +
|
| 27 | + # 1. Update the 'upstream' remote to point to the new public repository |
| 28 | + git remote set-url upstream git@github.com:MetOffice/<repo> |
| 29 | + # 2. Update your 'origin' remote to point to your NEW public fork |
| 30 | + git remote set-url origin git@github.com:<user>/<repo> |
| 31 | + # 3. Verify the changes |
| 32 | + git remote -v |
| 33 | +
|
| 34 | +#. Migrating unfinished work |
| 35 | + As existing PRs will be closed or disconnected, |
| 36 | + you will need to re-submit any open PRs from your new public fork. |
| 37 | + |
| 38 | + The "detached" state is a security feature to isolate private forks when the |
| 39 | + upstream parent becomes public. Only GitHub staff have the administrative |
| 40 | + privileges required to manually re-link the repository network while |
| 41 | + preserving existing PR data and history. |
| 42 | + |
| 43 | + One option is to make sure any work you wish to preserve is in a clone of your |
| 44 | + fork. Then recreate the fork from upstream using the same name as before. |
| 45 | + Pushing from your clone will connect to the new fork. However this will delete |
| 46 | + any pull requests you had open from the previous fork. |
| 47 | + |
| 48 | +**Note:** If you already have a lots of develop branches/PRs, its probably best to |
| 49 | +contact `GitHub Support and Submit a ticket |
| 50 | +<https://support.github.com/contact?legacy&subject=Attach%20Fork&tags=rr-forks>`_ |
| 51 | +to reattach your fork. Select your personal account from the drop down menu |
| 52 | +(as that is where your fork is, not the enterprise account) and use the |
| 53 | +following message: |
| 54 | + |
| 55 | + My upstream private repo became public, which detached my fork. I have open |
| 56 | + PRs I need to preserve. Please reattach my fork to the original network. |
| 57 | + |
| 58 | + Upstream URL: https://github.com/MetOffice/{repo-name} |
| 59 | + |
| 60 | + Fork URL: https://github.com/{user}/{repo-name} |
| 61 | + |
| 62 | +This process should usually get resolved within a day. |
0 commit comments