From c82917f9a9777becdcac132068b160ffa5025d97 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 26 Oct 2021 14:52:25 +1000 Subject: [PATCH] Add restore deleted repo in GHES --- .../index.md | 1 + .../restoring-a-deleted-repository.md | 34 +++++++++++++++++++ .../deleting-a-repository.md | 6 ++-- .../restoring-a-deleted-repository.md | 7 ++++ 4 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 content/admin/user-management/managing-repositories-in-your-enterprise/restoring-a-deleted-repository.md diff --git a/content/admin/user-management/managing-repositories-in-your-enterprise/index.md b/content/admin/user-management/managing-repositories-in-your-enterprise/index.md index 99953e30f95c..5cf00ef94dba 100644 --- a/content/admin/user-management/managing-repositories-in-your-enterprise/index.md +++ b/content/admin/user-management/managing-repositories-in-your-enterprise/index.md @@ -13,6 +13,7 @@ children: - /configuring-git-large-file-storage-for-your-enterprise - /migrating-to-internal-repositories - /disabling-git-ssh-access-on-your-enterprise + - /restoring-a-deleted-repository - /troubleshooting-service-hooks shortTitle: Manage repositories --- diff --git a/content/admin/user-management/managing-repositories-in-your-enterprise/restoring-a-deleted-repository.md b/content/admin/user-management/managing-repositories-in-your-enterprise/restoring-a-deleted-repository.md new file mode 100644 index 000000000000..a668538533b5 --- /dev/null +++ b/content/admin/user-management/managing-repositories-in-your-enterprise/restoring-a-deleted-repository.md @@ -0,0 +1,34 @@ +--- +title: Restoring a deleted repository +intro: Site administrators can restore deleted repositories to recover their contents. +versions: + ghes: '*' + ghae: '*' +topics: + - Enterprise + - Privacy + - Repositories +shortTitle: Restore a deleted repository +--- +Usually, if someone deletes a repository, it will be available on disk for 90 days and can be restored via the site admin dashboard. Unless a legal hold is in effect on a user or organization, after 90 days the repository is purged and deleted forever. + +## About repository restoration + +If a repository was part of a fork network when it was deleted, the restored repository will be detached from the original fork network. + +It can take up to an hour after a repository is deleted before that repository is available for restoration. + +Restoring a repository will not restore release attachments or team permissions. Issues that are restored will not be labeled. + +## Restoring a deleted repository + +{% data reusables.enterprise_site_admin_settings.access-settings %} +{% data reusables.enterprise_site_admin_settings.search-user-or-org %} +{% data reusables.enterprise_site_admin_settings.click-user-or-org %} +1. In the {% octicon "repo" aria-label="The repo icon" %} **Repositories** section, click the {% octicon "trash" aria-label="The trash icon" %} **Deleted repositories** link. +1. Find the repository you want to restore in the deleted repositories list, then to the right of the repository name click **Restore**. +1. To confirm you would like to restore the named repository, click **Restore**. + +## Further reading + +- "[Placing a legal hold on a user or organization](/admin/user-management/managing-users-in-your-enterprise/placing-a-legal-hold-on-a-user-or-organization)" diff --git a/content/repositories/creating-and-managing-repositories/deleting-a-repository.md b/content/repositories/creating-and-managing-repositories/deleting-a-repository.md index 33da27280681..647cf7c95530 100644 --- a/content/repositories/creating-and-managing-repositories/deleting-a-repository.md +++ b/content/repositories/creating-and-managing-repositories/deleting-a-repository.md @@ -24,13 +24,11 @@ topics: **Warnings**: - Deleting a repository will **permanently** delete release attachments and team permissions. This action **cannot** be undone. -- Deleting a private {% ifversion ghes or fpt or ghae or ghec %}or internal {% endif %}repository will delete all forks of the repository. +- Deleting a private or internal repository will delete all forks of the repository. {% endwarning %} -{% ifversion fpt or ghec %} -You can restore some deleted repositories within 90 days. For more information, see "[Restoring a deleted repository](/articles/restoring-a-deleted-repository)." -{% endif %} +Some deleted repositories can be restored within 90 days of deletion. {% ifversion ghes or ghae %}Your site administrator may be able to restore a deleted repository for you. For more information, see "[Restoring a deleted repository](/admin/user-management/managing-repositories-in-your-enterprise/restoring-a-deleted-repository)." {% else %}For more information, see "[Restoring a deleted repository](/articles/restoring-a-deleted-repository)."{% endif %} {% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} diff --git a/content/repositories/creating-and-managing-repositories/restoring-a-deleted-repository.md b/content/repositories/creating-and-managing-repositories/restoring-a-deleted-repository.md index b903538a2b02..6316b35dca91 100644 --- a/content/repositories/creating-and-managing-repositories/restoring-a-deleted-repository.md +++ b/content/repositories/creating-and-managing-repositories/restoring-a-deleted-repository.md @@ -8,10 +8,13 @@ redirect_from: versions: fpt: '*' ghec: '*' + ghes: '*' + ghae: '*' topics: - Repositories shortTitle: Restore deleted repository --- +{% ifversion fpt or ghec %} Anyone can restore deleted repositories that were owned by their own user account. Organization owners can restore deleted repositories that were owned by the organization. ## About repository restoration @@ -44,3 +47,7 @@ Restoring a repository will not restore release attachments or team permissions. ## Further reading - "[Deleting a repository](/articles/deleting-a-repository)" + +{% else %} +Usually, deleted repositories can be restored within 90 days by a {% data variables.product.prodname_enterprise %} site administrator. For more information, see "[Restoring a deleted repository](/admin/user-management/managing-repositories-in-your-enterprise/restoring-a-deleted-repository)." +{% endif %}