Skip to content

Commit c445897

Browse files
authored
Merge pull request #26047 from github/repo-sync
Repo sync
2 parents 37bc20c + cc4969c commit c445897

6 files changed

Lines changed: 123 additions & 3 deletions

File tree

content/admin/configuration/configuring-your-enterprise/command-line-utilities.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ You can add the optional `--prune` argument to remove unreachable Git objects th
860860

861861
{% warning %}
862862

863-
**Warning**: Before using the `--prune` argument to remove unreachable Git objects, put {% data variables.location.product_location %} into maintenance mode, or ensure all repositories within the same repository network are locked. For more information, see "[AUTOTITLE](/admin/configuration/configuring-your-enterprise/enabling-and-scheduling-maintenance-mode)."
863+
**Warning**: Before using the `--prune` argument to remove unreachable Git objects, put {% data variables.location.product_location %} into maintenance mode, or ensure all repositories within the same repository network are locked. For more information, see "[AUTOTITLE](/admin/configuration/configuring-your-enterprise/enabling-and-scheduling-maintenance-mode)" and "[AUTOTITLE](/admin/user-management/managing-repositories-in-your-enterprise/locking-a-repository)."
864864

865865
{% endwarning %}
866866

content/admin/user-management/managing-repositories-in-your-enterprise/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ children:
1616
- /configuring-git-large-file-storage-for-your-enterprise
1717
- /migrating-to-internal-repositories
1818
- /disabling-git-ssh-access-on-your-enterprise
19+
- /locking-a-repository
1920
- /restoring-a-deleted-repository
2021
- /troubleshooting-service-hooks
2122
shortTitle: Manage repositories
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: Locking a repository
3+
intro: You can prevent changes to a repository's code and other resources, such as issues and pull requests, by locking the repository.
4+
versions:
5+
ghes: '*'
6+
type: how_to
7+
topics:
8+
- Enterprise
9+
- Repositories
10+
shortTitle: Lock a repository
11+
---
12+
13+
## Locking a repository
14+
15+
{% data reusables.enterprise_site_admin_settings.access-settings %}
16+
{% data reusables.enterprise_site_admin_settings.repository-search %}
17+
{% data reusables.enterprise_site_admin_settings.click-repo %}
18+
{% data reusables.enterprise_site_admin_settings.admin-top-tab %}
19+
1. In the "Single Repository Lock" section, click **Lock**.
20+
21+
## Unlocking a repository
22+
23+
{% data reusables.enterprise_site_admin_settings.access-settings %}
24+
{% data reusables.enterprise_site_admin_settings.repository-search %}
25+
{% data reusables.enterprise_site_admin_settings.click-repo %}
26+
1. In the "Single Repository Lock" section, click **Unlock**.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: About locked repositories
3+
shortTitle: Locked repositories
4+
intro: Repositories can be locked to prevent changes, often for migrations.
5+
versions:
6+
fpt: '*'
7+
ghes: '*'
8+
ghec: '*'
9+
---
10+
11+
## About locked repositories
12+
13+
When you migrate repositories to or from {% data variables.product.prodname_dotcom %} products, your origin and destination repositories may be “locked” for migration. While a repository is locked, you will cannot make any changes to the repository, such as pushing commits, creating issues, or commenting on pull requests.
14+
15+
Whether your repositories will be locked during migration depends on the tooling you use and the options you choose when you run the migration. When a repository is locked, a banner with the following text is displayed on the repository's page on {% data variables.product.prodname_dotcom %}:
16+
17+
> This repository is currently being migrated. It's locked while the migration is in progress.
18+
19+
{% ifversion ghes %}
20+
Site administrators may also lock repositories for other reasons besides migrations.
21+
{% endif %}
22+
23+
Often, repositories are unlocked automatically when the migration is complete. In other cases, unlocking a repository is a manual step, and the process required to unlock a repository depends on the migration tool you used.
24+
25+
## Repositories locked by {% data variables.product.prodname_importer_proper_name %}
26+
27+
While a migration is in progress, access to the destination repository is locked by {% data variables.product.prodname_importer_proper_name %}. If the migration completes successfully, the repository will unlock automatically. However, if there's a problem with the migration, including a migration failure, the repository may remain locked.
28+
29+
{% data variables.product.prodname_importer_proper_name %} does not lock source repositories by default. Source repositories will only be locked if you specify the `--lock-source-repo` option in the {% data variables.product.prodname_cli %}, or the `lockSource` attribute in the `startRepositoryMigration` GraphQL mutation.
30+
31+
{% note %}
32+
33+
**Note:** We do not recommend locking source repositories unless you are certain you will not want to unlock them later. Consider archiving the repositories instead. For more information, see "[AUTOTITLE](/repositories/archiving-a-github-repository/archiving-repositories)."
34+
35+
{% endnote %}
36+
37+
For information about how to unlock repositories that were locked by {% data variables.product.prodname_importer_proper_name %}, see "[AUTOTITLE](/migrations/using-github-enterprise-importer/completing-your-migration-with-github-enterprise-importer/troubleshooting-your-migration-with-github-enterprise-importer#locked-repositories)."
38+
39+
## Repositories locked by the "Organization migrations" REST API
40+
41+
When you call the "[Start an organization migration](/rest/migrations/orgs#start-an-organization-migration)" endpoint to generate a migration archive for a source repository, the repository is not locked by default. The repository is only locked if you set the `lock_repositories` parameter to `true`.
42+
43+
If you lock a repository via this endpoint, you can unlock the repository using the "[Unlock an organization repository](/rest/migrations/orgs#unlock-an-organization-repository)" endpoint.
44+
45+
If the repository is stored on {% data variables.product.prodname_ghe_server %}, a site administrator can also unlock the repository using the site admin dashboard. For more information, see "[AUTOTITLE]({% ifversion not ghes %}/enterprise-server@latest{% endif %}/admin/user-management/managing-repositories-in-your-enterprise/locking-a-repository){% ifversion ghes %}."{% else %}" in the {% data variables.product.prodname_ghe_server %} documentation.{% endif %}
46+
47+
## Repositories locked by `ghe-migrator`
48+
49+
When you use `ghe-migrator`, the destination repository on {% data variables.product.prodname_ghe_server %} is locked by default and is not automatically unlocked.
50+
51+
If the import succeeded, you can unlock the repository with the `ghe-migrator unlock` command. For more information, see "[AUTOTITLE](/migrations/using-ghe-migrator/migrating-data-to-github-enterprise-server#unlocking-repositories-on-the-target-instance)."
52+
53+
If the import failed, not all of your data has been migrated, and we recommend deleting the repository and retrying the migration, to prevent data loss.
54+
55+
If you're sure you want to use the repository, a site administrator can unlock the repository using the site admin dashboard. For more information, see "[AUTOTITLE]({% ifversion not ghes %}/enterprise-server@latest{% endif %}/admin/user-management/managing-repositories-in-your-enterprise/locking-a-repository){% ifversion ghes %}."{% else %}" in the {% data variables.product.prodname_ghe_server %} documentation.{% endif %}
56+
57+
The source repository is not locked by default, only if the `--lock` argument is specified when preparing the repository for export with the `ghe-migrator add` command. To unlock the repository, use the `ghe-migrator unlock` command. For more information, see "[AUTOTITLE](/migrations/using-ghe-migrator/migrating-data-to-github-enterprise-server#unlocking-repositories-on-the-source)."
58+
59+
## Repositories locked by Enterprise Cloud Importer
60+
61+
When you use Enterprise Cloud Importer, the destination repository is locked by default and is not automatically unlocked.
62+
63+
If the import succeeded, you can unlock the repository by clicking the **Unlock** button in Enterprise Cloud Importer.
64+
65+
If the import failed, you cannot unlock the repository yourself. Because a failed migration means that not all of your data has been migrated, we recommend deleting the repository and retrying the migration, to prevent data loss.
66+
67+
If you’re sure you want to unlock the repository, contact {% data variables.contact.contact_support %}.
68+
69+
## Repositories locked by the `startImport` GraphQL mutation
70+
71+
When you use the `startImport` GraphQL mutation, the destination repository is locked by default and is not automatically unlocked.
72+
73+
If the import succeeded, you can unlock the repository with the `unlockImportedRepositories` GraphQL mutation. For documentation, contact your Expert Services or {% data variables.product.prodname_dotcom %} Partner representative.
74+
75+
If the import failed, you cannot unlock the repository yourself. Because a failed migration means that not all of your data has been migrated, we recommend deleting the repository and retrying the migration, to prevent data loss.
76+
77+
If you’re sure you want to unlock the repository, contact {% data variables.contact.contact_support %}.

content/migrations/overview/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ versions:
99
children:
1010
- /about-githubs-migration-tooling
1111
- /planning-your-migration-to-github
12+
- /about-locked-repositories
1213
---

content/migrations/using-github-enterprise-importer/completing-your-migration-with-github-enterprise-importer/troubleshooting-your-migration-with-github-enterprise-importer.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ You can temporarily disable your rulesets during your migration, or you can use
121121

122122
If you receive a `Git source migration failed` error with `GH007: Your push would publish a private email address`, the Git source you're trying to migrate includes commits authored by an email address that you have blocked from being pushed to {% data variables.product.prodname_dotcom %}. For more information, see "[AUTOTITLE]({% ifversion not fpt or ghec %}/enterprise-cloud@latest{% endif %}/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/blocking-command-line-pushes-that-expose-your-personal-email-address){% ifversion fpt or ghec %}."{% else %}" in the {% data variables.product.prodname_ghe_cloud %} documentation.{% endif %}
123123

124-
To resolve this error, you can either rewrite the Git history to remove the email address, or you can disable the "Block command line pushes that expose my email" setting.
124+
To resolve this error, you can either rewrite the Git history to remove the email address, or you can disable the "Block command line pushes that expose my email" setting.
125125

126126
## Troubleshooting successful migrations
127127

@@ -170,6 +170,21 @@ You can either update these references after the migration, or you can preserve
170170

171171
For example, if your source organization is `@octo-org`, and your `CODEOWNERS` file includes a reference to the team `@octo-org/octo-team`, you could rename the source organization to `@octo-org-temp` before your migration, allowing you to use `@octo-org` as the name of the new organization. Then, the migrated team would be called `@octo-org/octo-team`, and the `CODEOWNERS` file in the migrated repository will work as expected.
172172

173+
## Locked repositories
174+
175+
After a migration, you may find that your source or destination repositories are locked, disabling access to the repository's code and all of its resources, such as issues and pull requests. For more information about locked repositories, see "[AUTOTITLE](/migrations/overview/about-locked-repositories)."
176+
177+
The process for unlocking a repository depends on the {% data variables.product.prodname_dotcom %} product where the repository is stored.
178+
179+
- If the locked repository is on {% data variables.product.prodname_ghe_server %}, a site administrator can unlock the repository using the site admin dashboard. For more information, see "[AUTOTITLE]({% ifversion not ghes %}/enterprise-server@latest{% endif %}/admin/user-management/managing-repositories-in-your-enterprise/locking-a-repository){% ifversion ghes %}."{% else %}" in the {% data variables.product.prodname_ghe_server %} documentation.{% endif %}
180+
- If the locked repository is on {% data variables.product.prodname_dotcom_the_website %}, you can contact {% data variables.contact.contact_support %} to unlock the repository.
181+
182+
{% note %}
183+
184+
**Note:** If your migration failed, not all of your data was migrated. If you choose to unlock and use the repository, there will be data loss. Deleting the locked repository and retrying the migration may be a better option.
185+
186+
{% endnote %}
187+
173188
## Contacting {% data variables.contact.github_support %}
174189

175-
If you're still unable to resolve your issue after trying the troubleshooting steps above, you can contact {% data variables.contact.github_support %} through the {% data variables.contact.contact_enterprise_portal %}.
190+
If you're still unable to resolve your issue after trying the troubleshooting steps above, you can contact {% data variables.contact.github_support %} through the {% data variables.contact.contact_enterprise_portal %}.

0 commit comments

Comments
 (0)