Detaching a fork - GitHub Docs
https://docs.github.com/en/pull-requests/how-tos/work-with-forks/detaching-a-fork • 156 KB fetched Open original page
Detaching a fork - GitHub Docs Skip to main content
GitHub Docs Version: Free, Pro, & Team
Search or ask Copilot Search or ask Copilot
Select language: current language is English
Search or ask Copilot Search or ask Copilot
Open menu
Collapse sidebar Expand sidebar
Scroll breadcrumbs left
* Home
* Pull requests
* How-tos
* Work with forks
* Detach a fork
Scroll breadcrumbs right
Pull requests
*
*
* Get started
* About pull requests
* About stacked PRs
* About forks
* Pull request quickstart
* Stacked PRs quickstart
* Review quickstart
* Concepts
* Write code
* Help others review your changes
* Give reviews
* Resolve reviews
* Deploy code
* How-tos
* Commit changes
* Manage branches
* Commit to PR branch from fork
* Create a commit with multiple authors
* Change a commit message
* Compare commits
* Troubleshoot commits
* Create pull requests
* Create a pull request
* Create stacked PRs
* Create a PR from a fork
* Draft pull requests
* Manage stacked PRs
* Update the head branch
* Change the base branch
* Request a PR review
* Stacked pull requests
* Review pull requests
* Check out a PR locally
* Review proposed changes
* Review stacked PRs
* Review dependency changes
* Comment on a PR
* Approve PRs
* View a PR review
* Dismiss a PR review
* Incorporate feedback
* Merge and close
* Resolve merge conflicts
* Resolve merge conflicts in Git
* Troubleshoot status checks
* Troubleshoot stacked PRs
* Merge a pull request
* Merge PR with merge queue
* Merge PR automatically
* Merge stacked PRs
* CI for stacked PRs
* Revert a pull request
* Close a pull request
* Work with forks
* Fork a repository
* Configure a remote repository
* Sync a fork
* Allow changes to a branch
* Detach a fork
* Reference
* Pull requests
* Stacked pull requests
* Stacked PRs CLI commands
* Stacked PRs APIs and webhooks
* Branches
* Forks
* Commits
* Stacked PRs and other tools
* Using query parameters to create a pull request
* PR reviews
* Status checks
* Pull request merges
* Merge conflicts
* Manage and standardize pull requests
* Tutorials
* Stack pull requests
* Roll out stacked PRs
Detaching a fork
Disconnect a repository from its fork network by leaving the network or creating a standalone repository through manual steps.
Who can use this feature?
People with admin access for a forked repository can delete the forked repository.
Copy as Markdown
In this article
* Converting a fork into a standalone repository
* Leaving the fork network
* Manually leaving the fork network
Converting a fork into a standalone repository
To turn your fork into a standalone repository, you can leave the fork network. The new repository will no longer automatically sync with changes from the original repository. This is useful when you want to take your work 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. See Troubleshooting missing contributions .
* Leaving the fork network is permanent and the new repository cannot be reconnected to the fork network.
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
*
On GitHub, navigate to the main page of the repository.
*
Under your repository name, click Settings . If you cannot see the "Settings" tab, select the dropdown menu, then click Settings .
*
On the "General" settings page (which is selected by default), scroll down to the "Danger Zone" section, and click Leave fork network .
*
Read the warnings and click I have read and understand these effects .
*
To verify that you're detaching the correct repository, in the text box, type the name of the fork.
*
Click Leave fork network .
While the fork is being detached, some operations will be briefly unavailable. They will become available again after the fork becomes a standalone repository.
Manually leaving the fork network
To turn your fork into a standalone repository, you can clone the fork and use the clone to create a new repository. Then, delete the fork to remove the connection to the original network.
*
Open your terminal or Git Bash.
*
Create a bare clone of the fork.
git clone --bare https://github.com/EXAMPLE-USER/FORK.git
*
Delete the forked repository. See Deleting a repository .
Warning
Deleting a fork will permanently delete any associated pull requests and configurations. This action cannot be undone.
*
Create a new repository with the same name in the same location. See Creating a new repository .
*
Mirror-push the repository back to the same remote URL.
git --git-dir FORK.git push --mirror https://github.com/EXAMPLE-USER/FORK.git
*
Remove the temporary local clone you created earlier.
rm -rf FORK.git
See our support page on forks.
Back to top
Help and support
Was this Doc helpful?
Yes No
Help us make GitHub Docs great!
All Docs are open source. See something that's wrong or unclear? Submit a pull request.
Make a contribution
Still need help?
Ask the GitHub community Contact support Expert services Blog
GitHub Inc. © 2026 Terms Privacy Status Pricing
Links found on this page
- Skip to main content [direct]
- GitHub Docs [direct]
- Pull requests [direct]
- How-tos [direct]
- Work with forks [direct]
- About pull requests [direct]
- About stacked PRs [direct]
- About forks [direct]
- Pull request quickstart [direct]
- Stacked PRs quickstart [direct]
- Review quickstart [direct]
- Write code [direct]
- Help others review your changes [direct]
- Give reviews [direct]
- Resolve reviews [direct]
- Deploy code [direct]
- Manage branches [direct]
- Commit to PR branch from fork [direct]
- Create a commit with multiple authors [direct]
- Change a commit message [direct]
- Compare commits [direct]
- Troubleshoot commits [direct]
- Create a pull request [direct]
- Create stacked PRs [direct]
- Create a PR from a fork [direct]
- Draft pull requests [direct]
- Manage stacked PRs [direct]
- Update the head branch [direct]
- Change the base branch [direct]
- Request a PR review [direct]
- Stacked pull requests [direct]
- Check out a PR locally [direct]
- Review proposed changes [direct]
- Review stacked PRs [direct]
- Review dependency changes [direct]
- Comment on a PR [direct]
- Approve PRs [direct]
- View a PR review [direct]
- Dismiss a PR review [direct]
- Incorporate feedback [direct]
- Resolve merge conflicts [direct]
- Resolve merge conflicts in Git [direct]
- Troubleshoot status checks [direct]
- Troubleshoot stacked PRs [direct]
- Merge a pull request [direct]
- Merge PR with merge queue [direct]
- Merge PR automatically [direct]
- Merge stacked PRs [direct]
- CI for stacked PRs [direct]
- Revert a pull request [direct]
- Close a pull request [direct]
- Fork a repository [direct]
- Configure a remote repository [direct]
- Sync a fork [direct]
- Allow changes to a branch [direct]
- Pull requests [direct]
- Stacked pull requests [direct]
- Stacked PRs CLI commands [direct]
- Stacked PRs APIs and webhooks [direct]
- Branches [direct]
- Forks [direct]
- Commits [direct]
- Stacked PRs and other tools [direct]
- Using query parameters to create a pull request [direct]
- PR reviews [direct]
- Status checks [direct]
- Pull request merges [direct]
- Merge conflicts [direct]
- Manage and standardize pull requests [direct]
- Stack pull requests [direct]
- Roll out stacked PRs [direct]
- Troubleshooting missing contributions [direct]
- Deleting a repository [direct]
- Creating a new repository [direct]
- our support page [direct]
- Make a contribution [direct]
- Ask the GitHub community [direct]
- Contact support [direct]
- Expert services [direct]
- Blog [direct]
|
|