Skip to content

Latest commit

 

History

History
74 lines (53 loc) · 3.58 KB

File metadata and controls

74 lines (53 loc) · 3.58 KB
title intro versions topics permissions
Detaching a fork
You can disconnect a repository from its fork network by leaving the network or manually deleting the fork and recreating it without any connection to the original.
fpt ghes ghec
*
*
*
Pull requests
People with admin access for a forked repository can delete the forked repository.

Converting a fork into a standalone repository

To turn your fork into a standalone repository, you can leave the fork network ensuring the new repository will no longer automatically sync with changes from the original repository. This is useful when you want to take the work you are doing in a different direction or maintain distinct versions.

Warning

  • The new repository will not retain any of its issues, pull requests, wikis, stars, watchers, comments, child forks, or other metadata that may currently be associated with your current fork.
  • All git commit metadata will be preserved. Commits may become eligible to be counted as contributions if they meet certain criteria. For more information, see AUTOTITLE.
  • Leaving the fork network is permanent and the new repository cannot be reconnected to the fork network.

{% ifversion ghes %}

Note

If you are unable to detach a fork, contact your site administrator.

{% endif %}

Leaving the fork network

You can only detach forks with the leave network option when:

  • The fork is public
  • The fork is less than 1GB
  • The fork does not have any child forks attached

{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %}

  1. On the "General" settings page (which is selected by default), scroll down to the "Danger Zone" section, and click Leave fork network.
  2. Read the warnings and click I have read and understand these effects.
  3. To verify that you're detaching the correct repository, in the text box, type the name of the fork.
  4. Click Leave fork network.

While the fork is being detached, some operations will be briefly unavailable until the fork has been transitioned to a standalone repository.

Manually Leaving the fork network

To turn your fork into a standalone repository, you can clone the fork, use the clone to create a new repository, and then delete the fork removing the connection to the original network.

{% data reusables.command_line.open_the_multi_os_terminal %}

  1. Create a bare clone of the fork.

    git clone --bare https://{% data variables.product.product_url %}/EXAMPLE-USER/FORK.git
  2. Delete the forked repository. For more information, see AUTOTITLE.

    [!WARNING] Deleting a fork will permanently delete any associated pull requests and configurations. This action cannot be undone.

  3. Create a new repository with the same name in the same location. For more information, see AUTOTITLE.

  4. Mirror-push the repository back to the same remote URL.

    git --git-dir FORK.git push --mirror https://{% data variables.product.product_url %}/EXAMPLE-USER/FORK.git
  5. Remove temporary local clone you created earlier.

    rm -rf FORK.git

For more information, see our support page on forks.