「フォークを取り消す」には、目的に応じて次の2通りがあります。
- A. 完全に取り消す(= フォーク先リポジトリを削除)
- B. フォーク関係だけ解除してリポジトリ自体は残す(= Detach / フォークの切り離し)
各手順は契約しているプラン(Free,Pro,Team,Enterprise ServerのVersion)により、対応内容が異なる場合があります。詳しくは各バージョンの公式手順をご確認ください。
GitHub DocsのVersionについては、ご自身の環境に合わせて変更してください。

A. フォークを「削除」して取り消す(最もシンプル)
- 対象のフォークリポジトリを開く → Settings
- General → Danger Zone → “Delete this repository” をクリック
- 確認の指示に従い、リポジトリ名を入力して削除
削除後は 一時的に復元可能(約90日) の保留期間があります。必要なら「Deleted repositories」から復元できます。
- GitHub Docs(Deleting a repository)
https://docs.github.com/en/repositories/creating-and-managing-repositories/deleting-a-repository GitHub Docs - GitHub Community: 削除後の保持と復元期間の目安
https://github.com/orgs/community/discussions/42710 GitHub - Restoring a deleted repository
https://docs.github.com/en/repositories/creating-and-managing-repositories/restoring-a-deleted-repository - Detaching a fork
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/detaching-a-fork
B. フォーク関係だけを「解除」する(リポジトリは残す)
Detaching a fork(フォークの切り離し)を使うと、
「This repository was forked from …」の関係を外して 独立リポジトリ にできます。中身と履歴は残ります。
方法1:UI から “Leave fork network(フォークネットワークから離脱)”
- 対象リポジトリ → Settings → General → Danger Zone
- Leave fork network をクリック → 注意点を確認 → 実行
- GitHub Docs(Detaching a fork)
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/detaching-a-fork GitHub Docs - (Enterprise Server 版の手順例。UI項目名が Leave fork network になっています。)
GitHub Enterprise Server Docs(Detaching a fork)
https://docs.github.com/en/enterprise-server%403.17/pull-requests/collaborating-with-pull-requests/working-with-forks/detaching-a-fork
方法2:“コピー”した後に独立化(履歴を完全移行)
既存フォークを bare クローン
git clone --bare https://github.com/<you>/<fork>.git cd <fork>.gitGitHubで 空の Private リポジトリ を作成
ミラー push で履歴ごと移行
git push --mirror git@github.com:<you>/<new-repo>.git旧フォークは削除して完了(必要に応じて upstream を追加)
これは GitHub が案内している「フォークをネットワークから切り離す」実質的な手段の一つで、履歴・タグ・ブランチをそのまま移行できます。
GitHub Docs(Detaching a fork:概念と選択肢)(Ver.Free,Pro,Team)
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/detaching-a-fork
補足:可視性(Public/Private)の取り扱い
- Public の“フォーク”のままでは Private に変更できません。
まず B のいずれかで“フォーク関係を解除” して独立させてから、
Settings → Danger Zone → Change repository visibility で Private に変更します。
GitHub Docs(Setting repository visibility)
https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/setting-repository-visibility GitHub Docs
コメント