How to Unfork a GitHub Repository Without Deleting History
This guide explains why GitHub lacks an unfork feature, outlines the problems caused by forked repositories, and provides a step‑by‑step method using GitHub Support (with optional command‑line cloning) to detach a fork while preserving commit history and fork records.
Background: Developers often fork a repository and later make extensive changes, but GitHub does not provide an “Unfork/Detach” feature, leading to issues such as accidental pull requests to the upstream, loss of contributor visibility, and difficulty separating the fork while preserving issues, wikis, and pull‑request history.
Solution: The most reliable method is to contact GitHub Support via the unfork request form ( https://support.github.com/contact?tags=rr-forks ), select the appropriate account or organization, enter “unfork” in the subject to trigger the virtual assistant, answer the assistant’s questions, and submit the request. If the repository has child forks, choose “Bring the child forks with the repository” to retain their fork records.
Alternative method: To keep the Git commit history, you can clone the repository bare and push it as a mirror:
git clone --bare git push --mirrorThis preserves the full commit history but cannot retain Issues, Wikis, or Pull Requests.
Hope this information helps those needing to detach a forked repository.
References:
Delete fork dependency of a GitHub repository – Stack Overflow
Unfork a Github fork without deleting – Stack Overflow
DevOps Engineer
DevOps engineer, Pythonista and FOSS contributor. Created cpp-linter, commit-check, etc.; contributed to PyPA.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.