diff --git a/translations/log/msft-cn-resets.csv b/translations/log/msft-cn-resets.csv index a224989154..8a3de1d8f1 100644 --- a/translations/log/msft-cn-resets.csv +++ b/translations/log/msft-cn-resets.csv @@ -53,6 +53,7 @@ translations/zh-CN/content/account-and-profile/setting-up-and-managing-your-pers translations/zh-CN/content/actions/automating-builds-and-tests/building-and-testing-nodejs-or-python.md,file deleted because it no longer exists in main translations/zh-CN/content/admin/code-security/managing-github-advanced-security-for-your-enterprise/deploying-github-advanced-security-in-your-enterprise.md,file deleted because it no longer exists in main translations/zh-CN/content/admin/code-security/managing-github-advanced-security-for-your-enterprise/overview-of-github-advanced-security-deployment.md,file deleted because it no longer exists in main +translations/zh-CN/content/admin/configuration/configuring-your-enterprise/restricting-network-traffic-to-your-enterprise.md,file deleted because it no longer exists in main translations/zh-CN/content/admin/configuration/configuring-your-enterprise/troubleshooting-ssl-errors.md,file deleted because it no longer exists in main translations/zh-CN/content/admin/github-actions/enabling-github-actions-for-github-enterprise-server/enabling-github-actions-with-minio-gateway-for-nas-storage.md,file deleted because it no longer exists in main translations/zh-CN/content/admin/identity-and-access-management/authenticating-users-for-your-github-enterprise-server-instance/index.md,file deleted because it no longer exists in main @@ -229,6 +230,7 @@ translations/zh-CN/content/rest/reference/users.md,file deleted because it no lo translations/zh-CN/content/rest/reference/webhooks.md,file deleted because it no longer exists in main translations/zh-CN/content/site-policy/privacy-policies/github-data-protection-agreement.md,file deleted because it no longer exists in main translations/zh-CN/content/sponsors/receiving-sponsorships-through-github-sponsors/setting-up-github-sponsors-for-your-user-account.md,file deleted because it no longer exists in main +translations/zh-CN/data/features/ip-allow-list-address-check.yml,file deleted because it no longer exists in main translations/zh-CN/data/features/security-overview-views.yml,file deleted because it no longer exists in main translations/zh-CN/data/glossaries/internal.yml,file deleted because it no longer exists in main translations/zh-CN/data/graphql/ghes-3.1/graphql_previews.enterprise.yml,file deleted because it no longer exists in main @@ -388,6 +390,7 @@ translations/zh-CN/data/reusables/dotcom_billing/monthly-spending-limit-codespac translations/zh-CN/data/reusables/dotcom_billing/pricing_calculator/pricing_cal_codespaces.md,file deleted because it no longer exists in main translations/zh-CN/data/reusables/education/upgrade-organization.md,file deleted because it no longer exists in main translations/zh-CN/data/reusables/education/upgrade-page.md,file deleted because it no longer exists in main +translations/zh-CN/data/reusables/enterprise-accounts/oidc-beta-notice.md,file deleted because it no longer exists in main translations/zh-CN/data/reusables/enterprise-accounts/repository-visibility-policy.md,file deleted because it no longer exists in main translations/zh-CN/data/reusables/enterprise-licensing/you-can-sync-for-a-combined-view.md,file deleted because it no longer exists in main translations/zh-CN/data/reusables/enterprise_management_console/username_normalization_sample.md,file deleted because it no longer exists in main @@ -488,6 +491,7 @@ translations/zh-CN/content/actions/managing-issues-and-pull-requests/moving-assi translations/zh-CN/content/actions/managing-workflow-runs/disabling-and-enabling-a-workflow.md,rendering error translations/zh-CN/content/actions/managing-workflow-runs/manually-running-a-workflow.md,rendering error translations/zh-CN/content/actions/managing-workflow-runs/re-running-workflows-and-jobs.md,rendering error +translations/zh-CN/content/actions/migrating-to-github-actions/automating-migration-with-github-actions-importer.md,rendering error translations/zh-CN/content/actions/monitoring-and-troubleshooting-workflows/viewing-job-execution-time.md,rendering error translations/zh-CN/content/actions/publishing-packages/publishing-docker-images.md,rendering error translations/zh-CN/content/actions/publishing-packages/publishing-nodejs-packages.md,broken liquid tags @@ -499,7 +503,6 @@ translations/zh-CN/content/actions/using-github-hosted-runners/about-github-host translations/zh-CN/content/actions/using-github-hosted-runners/controlling-access-to-larger-runners.md,rendering error translations/zh-CN/content/actions/using-github-hosted-runners/using-larger-runners.md,rendering error translations/zh-CN/content/actions/using-workflows/about-workflows.md,rendering error -translations/zh-CN/content/actions/using-workflows/caching-dependencies-to-speed-up-workflows.md,broken liquid tags translations/zh-CN/content/actions/using-workflows/creating-starter-workflows-for-your-organization.md,rendering error translations/zh-CN/content/actions/using-workflows/events-that-trigger-workflows.md,rendering error translations/zh-CN/content/actions/using-workflows/reusing-workflows.md,rendering error @@ -536,9 +539,7 @@ translations/zh-CN/content/admin/configuration/configuring-your-enterprise/confi translations/zh-CN/content/admin/configuration/configuring-your-enterprise/configuring-web-commit-signing.md,rendering error translations/zh-CN/content/admin/configuration/configuring-your-enterprise/enabling-and-scheduling-maintenance-mode.md,rendering error translations/zh-CN/content/admin/configuration/configuring-your-enterprise/enabling-private-mode.md,rendering error -translations/zh-CN/content/admin/configuration/configuring-your-enterprise/initializing-github-ae.md,rendering error translations/zh-CN/content/admin/configuration/configuring-your-enterprise/managing-github-mobile-for-your-enterprise.md,rendering error -translations/zh-CN/content/admin/configuration/configuring-your-enterprise/restricting-network-traffic-to-your-enterprise.md,broken liquid tags translations/zh-CN/content/admin/configuration/configuring-your-enterprise/site-admin-dashboard.md,rendering error translations/zh-CN/content/admin/configuration/configuring-your-enterprise/troubleshooting-tls-errors.md,rendering error translations/zh-CN/content/admin/enterprise-management/caching-repositories/about-repository-caching.md,rendering error @@ -546,7 +547,6 @@ translations/zh-CN/content/admin/enterprise-management/caching-repositories/conf translations/zh-CN/content/admin/enterprise-management/caching-repositories/index.md,rendering error translations/zh-CN/content/admin/enterprise-management/configuring-clustering/cluster-network-configuration.md,broken liquid tags translations/zh-CN/content/admin/enterprise-management/configuring-clustering/configuring-high-availability-replication-for-a-cluster.md,broken liquid tags -translations/zh-CN/content/admin/enterprise-management/configuring-clustering/initializing-the-cluster.md,broken liquid tags translations/zh-CN/content/admin/enterprise-management/monitoring-your-appliance/accessing-the-monitor-dashboard.md,rendering error translations/zh-CN/content/admin/enterprise-management/monitoring-your-appliance/configuring-collectd.md,rendering error translations/zh-CN/content/admin/enterprise-management/monitoring-your-appliance/generating-a-health-check-for-your-enterprise.md,rendering error @@ -559,12 +559,12 @@ translations/zh-CN/content/admin/enterprise-management/updating-the-virtual-mach translations/zh-CN/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/upgrading-github-enterprise-server.md,rendering error translations/zh-CN/content/admin/github-actions/advanced-configuration-and-troubleshooting/troubleshooting-github-actions-for-your-enterprise.md,rendering error translations/zh-CN/content/admin/github-actions/advanced-configuration-and-troubleshooting/using-a-staging-environment.md,rendering error +translations/zh-CN/content/admin/github-actions/enabling-github-actions-for-github-enterprise-server/enabling-github-actions-with-minio-storage.md,rendering error translations/zh-CN/content/admin/github-actions/enabling-github-actions-for-github-enterprise-server/managing-self-hosted-runners-for-dependabot-updates.md,rendering error translations/zh-CN/content/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/about-github-actions-for-enterprises.md,rendering error translations/zh-CN/content/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-server.md,rendering error translations/zh-CN/content/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-self-hosted-runners-for-your-enterprise.md,rendering error translations/zh-CN/content/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/introducing-github-actions-to-your-enterprise.md,rendering error -translations/zh-CN/content/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/migrating-your-enterprise-to-github-actions.md,broken liquid tags translations/zh-CN/content/admin/github-actions/managing-access-to-actions-from-githubcom/about-using-actions-in-your-enterprise.md,rendering error translations/zh-CN/content/admin/identity-and-access-management/index.md,broken liquid tags translations/zh-CN/content/admin/identity-and-access-management/managing-iam-for-your-enterprise/changing-authentication-methods.md,rendering error @@ -576,6 +576,7 @@ translations/zh-CN/content/admin/identity-and-access-management/using-built-in-a translations/zh-CN/content/admin/identity-and-access-management/using-built-in-authentication/inviting-people-to-use-your-instance.md,rendering error translations/zh-CN/content/admin/identity-and-access-management/using-cas-for-enterprise-iam/index.md,rendering error translations/zh-CN/content/admin/identity-and-access-management/using-cas-for-enterprise-iam/using-cas.md,rendering error +translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/about-enterprise-managed-users.md,broken liquid tags translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/about-support-for-your-idps-conditional-access-policy.md,rendering error translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/configuring-oidc-for-enterprise-managed-users.md,rendering error translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/configuring-saml-single-sign-on-for-enterprise-managed-users.md,rendering error @@ -583,7 +584,6 @@ translations/zh-CN/content/admin/identity-and-access-management/using-enterprise translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/migrating-from-saml-to-oidc.md,rendering error translations/zh-CN/content/admin/identity-and-access-management/using-ldap-for-enterprise-iam/index.md,rendering error translations/zh-CN/content/admin/identity-and-access-management/using-saml-for-enterprise-iam/about-saml-for-enterprise-iam.md,rendering error -translations/zh-CN/content/admin/identity-and-access-management/using-saml-for-enterprise-iam/configuring-authentication-and-provisioning-for-your-enterprise-using-azure-ad.md,broken liquid tags translations/zh-CN/content/admin/identity-and-access-management/using-saml-for-enterprise-iam/configuring-saml-single-sign-on-for-your-enterprise.md,broken liquid tags translations/zh-CN/content/admin/identity-and-access-management/using-saml-for-enterprise-iam/enabling-encrypted-assertions.md,rendering error translations/zh-CN/content/admin/identity-and-access-management/using-saml-for-enterprise-iam/saml-configuration-reference.md,broken liquid tags @@ -613,7 +613,6 @@ translations/zh-CN/content/admin/packages/enabling-github-packages-with-azure-bl translations/zh-CN/content/admin/packages/enabling-github-packages-with-minio.md,rendering error translations/zh-CN/content/admin/packages/getting-started-with-github-packages-for-your-enterprise.md,rendering error translations/zh-CN/content/admin/packages/migrating-your-enterprise-to-the-container-registry-from-the-docker-registry.md,rendering error -translations/zh-CN/content/admin/packages/quickstart-for-configuring-your-minio-storage-bucket-for-github-packages.md,rendering error translations/zh-CN/content/admin/policies/enforcing-policies-for-your-enterprise/about-enterprise-policies.md,broken liquid tags translations/zh-CN/content/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise.md,rendering error translations/zh-CN/content/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-security-settings-in-your-enterprise.md,broken liquid tags @@ -635,7 +634,6 @@ translations/zh-CN/content/admin/user-management/migrating-data-to-and-from-your translations/zh-CN/content/admin/user-management/migrating-data-to-and-from-your-enterprise/migrating-data-to-your-enterprise.md,rendering error translations/zh-CN/content/authentication/authenticating-with-saml-single-sign-on/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on.md,rendering error translations/zh-CN/content/authentication/authenticating-with-saml-single-sign-on/authorizing-an-ssh-key-for-use-with-saml-single-sign-on.md,rendering error -translations/zh-CN/content/authentication/authenticating-with-saml-single-sign-on/viewing-and-managing-your-active-saml-sessions.md,rendering error translations/zh-CN/content/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account.md,rendering error translations/zh-CN/content/authentication/connecting-to-github-with-ssh/checking-for-existing-ssh-keys.md,rendering error translations/zh-CN/content/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md,rendering error @@ -644,7 +642,6 @@ translations/zh-CN/content/authentication/keeping-your-account-and-data-secure/a translations/zh-CN/content/authentication/keeping-your-account-and-data-secure/authorizing-oauth-apps.md,rendering error translations/zh-CN/content/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token.md,rendering error translations/zh-CN/content/authentication/keeping-your-account-and-data-secure/creating-a-strong-password.md,rendering error -translations/zh-CN/content/authentication/keeping-your-account-and-data-secure/index.md,rendering error translations/zh-CN/content/authentication/keeping-your-account-and-data-secure/preventing-unauthorized-access.md,rendering error translations/zh-CN/content/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository.md,rendering error translations/zh-CN/content/authentication/keeping-your-account-and-data-secure/reviewing-your-deploy-keys.md,rendering error @@ -657,6 +654,7 @@ translations/zh-CN/content/authentication/managing-commit-signature-verification translations/zh-CN/content/authentication/managing-commit-signature-verification/associating-an-email-with-your-gpg-key.md,rendering error translations/zh-CN/content/authentication/managing-commit-signature-verification/displaying-verification-statuses-for-all-of-your-commits.md,rendering error translations/zh-CN/content/authentication/managing-commit-signature-verification/index.md,broken liquid tags +translations/zh-CN/content/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key.md,broken liquid tags translations/zh-CN/content/authentication/securing-your-account-with-two-factor-authentication-2fa/about-two-factor-authentication.md,rendering error translations/zh-CN/content/authentication/securing-your-account-with-two-factor-authentication-2fa/accessing-github-using-two-factor-authentication.md,broken liquid tags translations/zh-CN/content/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication.md,rendering error @@ -671,8 +669,6 @@ translations/zh-CN/content/billing/managing-billing-for-github-actions/about-bil translations/zh-CN/content/billing/managing-billing-for-github-advanced-security/about-billing-for-github-advanced-security.md,broken liquid tags translations/zh-CN/content/billing/managing-billing-for-github-advanced-security/viewing-your-github-advanced-security-usage.md,rendering error translations/zh-CN/content/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces.md,rendering error -translations/zh-CN/content/billing/managing-billing-for-github-codespaces/index.md,broken liquid tags -translations/zh-CN/content/billing/managing-billing-for-github-codespaces/viewing-your-github-codespaces-usage.md,broken liquid tags translations/zh-CN/content/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot.md,broken liquid tags translations/zh-CN/content/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription.md,broken liquid tags translations/zh-CN/content/billing/managing-billing-for-github-packages/about-billing-for-github-packages.md,rendering error @@ -728,6 +724,7 @@ translations/zh-CN/content/code-security/secret-scanning/managing-alerts-from-se translations/zh-CN/content/code-security/secret-scanning/protecting-pushes-with-secret-scanning.md,rendering error translations/zh-CN/content/code-security/secret-scanning/pushing-a-branch-blocked-by-push-protection.md,rendering error translations/zh-CN/content/code-security/security-advisories/global-security-advisories/about-the-github-advisory-database.md,rendering error +translations/zh-CN/content/code-security/security-advisories/guidance-on-reporting-and-writing/managing-privately-reported-security-vulnerabilities.md,rendering error translations/zh-CN/content/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository.md,rendering error translations/zh-CN/content/code-security/security-overview/about-the-security-overview.md,rendering error translations/zh-CN/content/code-security/security-overview/filtering-alerts-in-the-security-overview.md,rendering error @@ -736,62 +733,17 @@ translations/zh-CN/content/code-security/supply-chain-security/end-to-end-supply translations/zh-CN/content/code-security/supply-chain-security/end-to-end-supply-chain/securing-code.md,rendering error translations/zh-CN/content/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review.md,rendering error translations/zh-CN/content/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph.md,rendering error -translations/zh-CN/content/code-security/supply-chain-security/understanding-your-software-supply-chain/configuring-dependency-review.md,broken liquid tags translations/zh-CN/content/code-security/supply-chain-security/understanding-your-software-supply-chain/configuring-the-dependency-graph.md,broken liquid tags -translations/zh-CN/content/codespaces/codespaces-reference/disaster-recovery-for-github-codespaces.md,broken liquid tags translations/zh-CN/content/codespaces/codespaces-reference/security-in-github-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/codespaces-reference/using-github-copilot-in-github-codespaces.md,broken liquid tags translations/zh-CN/content/codespaces/codespaces-reference/using-the-vs-code-command-palette-in-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace.md,broken liquid tags -translations/zh-CN/content/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account.md,broken liquid tags -translations/zh-CN/content/codespaces/customizing-your-codespace/renaming-a-codespace.md,broken liquid tags -translations/zh-CN/content/codespaces/customizing-your-codespace/setting-your-default-editor-for-github-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/customizing-your-codespace/setting-your-timeout-period-for-github-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/developing-in-codespaces/connecting-to-a-private-network.md,broken liquid tags -translations/zh-CN/content/codespaces/developing-in-codespaces/deleting-a-codespace.md,broken liquid tags -translations/zh-CN/content/codespaces/developing-in-codespaces/developing-in-a-codespace.md,broken liquid tags -translations/zh-CN/content/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace.md,broken liquid tags -translations/zh-CN/content/codespaces/developing-in-codespaces/opening-an-existing-codespace.md,broken liquid tags -translations/zh-CN/content/codespaces/developing-in-codespaces/stopping-and-starting-a-codespace.md,broken liquid tags -translations/zh-CN/content/codespaces/developing-in-codespaces/using-github-codespaces-for-pull-requests.md,broken liquid tags -translations/zh-CN/content/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code.md,rendering error -translations/zh-CN/content/codespaces/developing-in-codespaces/using-source-control-in-your-codespace.md,broken liquid tags -translations/zh-CN/content/codespaces/getting-started/deep-dive.md,broken liquid tags -translations/zh-CN/content/codespaces/getting-started/quickstart.md,broken liquid tags -translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/enabling-github-codespaces-for-your-organization.md,broken liquid tags -translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/index.md,broken liquid tags -translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/listing-the-codespaces-in-your-organization.md,broken liquid tags -translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/managing-repository-access-for-your-organizations-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types.md,broken liquid tags -translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period.md,broken liquid tags -translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports.md,broken liquid tags -translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-github-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/managing-your-codespaces/managing-gpg-verification-for-github-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/managing-your-codespaces/managing-repository-access-for-your-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/managing-your-codespaces/reviewing-your-security-logs-for-github-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/prebuilding-your-codespaces/about-github-codespaces-prebuilds.md,broken liquid tags +translations/zh-CN/content/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository.md,rendering error +translations/zh-CN/content/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template.md,rendering error +translations/zh-CN/content/codespaces/developing-in-codespaces/the-codespace-lifecycle.md,broken liquid tags translations/zh-CN/content/codespaces/prebuilding-your-codespaces/configuring-prebuilds.md,rendering error -translations/zh-CN/content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md,broken liquid tags -translations/zh-CN/content/codespaces/prebuilding-your-codespaces/testing-dev-container-changes.md,broken liquid tags translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/adding-a-codespaces-badge.md,rendering error -translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers.md,broken liquid tags -translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-a-minimum-specification-for-codespace-machines.md,broken liquid tags -translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-dotnet-project-for-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-java-project-for-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-nodejs-project-for-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-python-project-for-codespaces.md,broken liquid tags +translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/adding-features-to-a-devcontainer-file.md,broken liquid tags translations/zh-CN/content/codespaces/the-githubdev-web-based-editor.md,rendering error -translations/zh-CN/content/codespaces/troubleshooting/exporting-changes-to-a-branch.md,broken liquid tags -translations/zh-CN/content/codespaces/troubleshooting/github-codespaces-logs.md,broken liquid tags -translations/zh-CN/content/codespaces/troubleshooting/index.md,broken liquid tags -translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-creation-and-deletion-of-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-port-forwarding-for-github-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-prebuilds.md,broken liquid tags -translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-your-connection-to-github-codespaces.md,broken liquid tags -translations/zh-CN/content/codespaces/troubleshooting/working-with-support-for-github-codespaces.md,broken liquid tags +translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-prebuilds.md,rendering error translations/zh-CN/content/communities/documenting-your-project-with-wikis/about-wikis.md,rendering error translations/zh-CN/content/communities/documenting-your-project-with-wikis/changing-access-permissions-for-wikis.md,rendering error translations/zh-CN/content/communities/documenting-your-project-with-wikis/editing-wiki-content.md,rendering error @@ -830,14 +782,12 @@ translations/zh-CN/content/discussions/guides/finding-your-discussions.md,render translations/zh-CN/content/discussions/managing-discussions-for-your-community/managing-categories-for-discussions.md,rendering error translations/zh-CN/content/discussions/managing-discussions-for-your-community/managing-discussions.md,rendering error translations/zh-CN/content/discussions/managing-discussions-for-your-community/moderating-discussions.md,rendering error -translations/zh-CN/content/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-students/about-github-global-campus-for-students.md,broken liquid tags -translations/zh-CN/content/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-teachers/about-github-global-campus-for-teachers.md,broken liquid tags translations/zh-CN/content/education/manage-coursework-with-github-classroom/get-started-with-github-classroom/glossary.md,broken liquid tags translations/zh-CN/content/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide/about-using-makecode-arcade-with-github-classroom.md,rendering error translations/zh-CN/content/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide/integrate-github-classroom-with-an-ide.md,broken liquid tags -translations/zh-CN/content/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide/using-github-codespaces-with-github-classroom.md,broken liquid tags translations/zh-CN/content/education/manage-coursework-with-github-classroom/learn-with-github-classroom/view-autograding-results.md,rendering error translations/zh-CN/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/create-a-group-assignment.md,rendering error +translations/zh-CN/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/create-an-individual-assignment.md,broken liquid tags translations/zh-CN/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/manage-classrooms.md,broken liquid tags translations/zh-CN/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/use-the-git-and-github-starter-assignment.md,broken liquid tags translations/zh-CN/content/get-started/customizing-your-github-workflow/exploring-integrations/github-extensions-and-integrations.md,rendering error @@ -871,12 +821,12 @@ translations/zh-CN/content/get-started/signing-up-for-github/setting-up-a-trial- translations/zh-CN/content/get-started/signing-up-for-github/verifying-your-email-address.md,rendering error translations/zh-CN/content/get-started/using-git/about-git-rebase.md,rendering error translations/zh-CN/content/get-started/using-git/splitting-a-subfolder-out-into-a-new-repository.md,rendering error -translations/zh-CN/content/get-started/using-github/github-command-palette.md,rendering error translations/zh-CN/content/get-started/using-github/github-mobile.md,rendering error translations/zh-CN/content/get-started/using-github/keyboard-shortcuts.md,rendering error translations/zh-CN/content/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/about-writing-and-formatting-on-github.md,broken liquid tags translations/zh-CN/content/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax.md,rendering error translations/zh-CN/content/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/quickstart-for-writing-on-github.md,rendering error +translations/zh-CN/content/get-started/writing-on-github/working-with-advanced-formatting/about-task-lists.md,rendering error translations/zh-CN/content/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls.md,broken liquid tags translations/zh-CN/content/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions.md,rendering error translations/zh-CN/content/github-cli/github-cli/quickstart.md,rendering error @@ -894,12 +844,12 @@ translations/zh-CN/content/graphql/reference/unions.md,rendering error translations/zh-CN/content/issues/organizing-your-work-with-project-boards/managing-project-boards/changing-project-board-visibility.md,rendering error translations/zh-CN/content/issues/organizing-your-work-with-project-boards/managing-project-boards/copying-a-project-board.md,rendering error translations/zh-CN/content/issues/organizing-your-work-with-project-boards/managing-project-boards/creating-a-project-board.md,rendering error -translations/zh-CN/content/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects.md,broken liquid tags translations/zh-CN/content/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue.md,rendering error translations/zh-CN/content/organizations/collaborating-with-groups-in-organizations/about-your-organizations-news-feed.md,rendering error translations/zh-CN/content/organizations/granting-access-to-your-organization-with-saml-single-sign-on/about-two-factor-authentication-and-saml-single-sign-on.md,rendering error translations/zh-CN/content/organizations/granting-access-to-your-organization-with-saml-single-sign-on/viewing-and-managing-a-members-saml-access-to-your-organization.md,rendering error translations/zh-CN/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/accessing-compliance-reports-for-your-organization.md,rendering error +translations/zh-CN/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization.md,broken liquid tags translations/zh-CN/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-security-and-analysis-settings-for-your-organization.md,rendering error translations/zh-CN/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/reviewing-the-audit-log-for-your-organization.md,rendering error translations/zh-CN/content/organizations/managing-git-access-to-your-organizations-repositories/about-ssh-certificate-authorities.md,broken liquid tags @@ -948,7 +898,6 @@ translations/zh-CN/content/pull-requests/collaborating-with-pull-requests/propos translations/zh-CN/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/keeping-your-pull-request-in-sync-with-the-base-branch.md,rendering error translations/zh-CN/content/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-dependency-changes-in-a-pull-request.md,rendering error translations/zh-CN/content/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request.md,rendering error -translations/zh-CN/content/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks.md,broken liquid tags translations/zh-CN/content/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork.md,rendering error translations/zh-CN/content/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/changing-a-commit-message.md,rendering error translations/zh-CN/content/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-on-behalf-of-an-organization.md,rendering error @@ -1021,9 +970,7 @@ translations/zh-CN/content/rest/packages.md,broken liquid tags translations/zh-CN/content/rest/projects/projects.md,broken liquid tags translations/zh-CN/content/rest/scim.md,rendering error translations/zh-CN/content/rest/teams/team-sync.md,rendering error -translations/zh-CN/content/search-github/getting-started-with-searching-on-github/about-searching-on-github.md,rendering error translations/zh-CN/content/search-github/getting-started-with-searching-on-github/enabling-githubcom-repository-search-from-your-private-enterprise-environment.md,rendering error -translations/zh-CN/content/search-github/searching-on-github/searching-code.md,broken liquid tags translations/zh-CN/content/search-github/searching-on-github/searching-for-repositories.md,rendering error translations/zh-CN/content/sponsors/receiving-sponsorships-through-github-sponsors/managing-your-sponsorship-tiers.md,broken liquid tags translations/zh-CN/content/sponsors/receiving-sponsorships-through-github-sponsors/setting-up-github-sponsors-for-your-organization.md,rendering error @@ -1083,6 +1030,7 @@ translations/zh-CN/data/reusables/actions/settings-ui/settings-actions-pages-cus translations/zh-CN/data/reusables/actions/settings-ui/settings-actions-runner-groups.md,rendering error translations/zh-CN/data/reusables/actions/settings-ui/settings-actions-runners.md,rendering error translations/zh-CN/data/reusables/actions/sidebar-secret.md,rendering error +translations/zh-CN/data/reusables/actions/supported-github-runners.md,broken liquid tags translations/zh-CN/data/reusables/actions/upgrade-runners-before-upgrade-ghes.md,rendering error translations/zh-CN/data/reusables/actions/workflow-basic-example-and-explanation.md,rendering error translations/zh-CN/data/reusables/actions/workflow-dispatch-inputs.md,rendering error @@ -1107,20 +1055,17 @@ translations/zh-CN/data/reusables/code-scanning/enterprise-enable-code-scanning. translations/zh-CN/data/reusables/code-scanning/licensing-note.md,broken liquid tags translations/zh-CN/data/reusables/code-scanning/run-additional-queries.md,broken liquid tags translations/zh-CN/data/reusables/code-scanning/what-is-codeql-cli.md,rendering error -translations/zh-CN/data/reusables/codespaces/codespaces-disabling-org-billing.md,broken liquid tags -translations/zh-CN/data/reusables/codespaces/codespaces-spending-limit-requirement.md,broken liquid tags -translations/zh-CN/data/reusables/codespaces/creating-a-codespace-in-vscode.md,rendering error translations/zh-CN/data/reusables/codespaces/customize-vcpus-and-ram.md,broken liquid tags translations/zh-CN/data/reusables/codespaces/next-steps-adding-devcontainer.md,broken liquid tags translations/zh-CN/data/reusables/codespaces/prebuilds-crossreference.md,broken liquid tags translations/zh-CN/data/reusables/codespaces/rebuild-command.md,broken liquid tags translations/zh-CN/data/reusables/codespaces/secrets-on-start.md,broken liquid tags -translations/zh-CN/data/reusables/codespaces/use-chrome.md,broken liquid tags translations/zh-CN/data/reusables/command_line/provide-an-access-token.md,broken liquid tags translations/zh-CN/data/reusables/copilot/install-copilot-in-neovim.md,broken liquid tags translations/zh-CN/data/reusables/dependabot/beta-security-and-version-updates.md,rendering error translations/zh-CN/data/reusables/dependabot/default-dependencies-allow-ignore.md,broken liquid tags translations/zh-CN/data/reusables/dependabot/dependabot-alerts-dependency-scope.md,broken liquid tags +translations/zh-CN/data/reusables/dependabot/dependabot-alerts-filters.md,rendering error translations/zh-CN/data/reusables/dependabot/enabling-disabling-dependency-graph-private-repo.md,rendering error translations/zh-CN/data/reusables/dependabot/sidebar-secret.md,rendering error translations/zh-CN/data/reusables/dependabot/supported-package-managers.md,rendering error @@ -1133,6 +1078,7 @@ translations/zh-CN/data/reusables/dotcom_billing/view-all-subscriptions.md,rende translations/zh-CN/data/reusables/enterprise-accounts/actions-packages-report-download-enterprise-accounts.md,broken liquid tags translations/zh-CN/data/reusables/enterprise-accounts/billing-microsoft-ea-overview.md,broken liquid tags translations/zh-CN/data/reusables/enterprise-accounts/dormant-user-activity.md,rendering error +translations/zh-CN/data/reusables/enterprise-accounts/emu-azure-admin-consent.md,broken liquid tags translations/zh-CN/data/reusables/enterprise-accounts/emu-cap-validates.md,broken liquid tags translations/zh-CN/data/reusables/enterprise-accounts/emu-forks.md,rendering error translations/zh-CN/data/reusables/enterprise-accounts/emu-permission-follow.md,broken liquid tags @@ -1175,7 +1121,10 @@ translations/zh-CN/data/reusables/getting-started/enforcing-repo-management-poli translations/zh-CN/data/reusables/getting-started/enterprise-advanced-security.md,broken liquid tags translations/zh-CN/data/reusables/getting-started/managing-enterprise-members.md,rendering error translations/zh-CN/data/reusables/git/git-push.md,rendering error -translations/zh-CN/data/reusables/identity-and-permissions/ip-allow-lists-enable.md,broken liquid tags +translations/zh-CN/data/reusables/identity-and-permissions/about-adding-ip-allow-list-entries.md,broken liquid tags +translations/zh-CN/data/reusables/identity-and-permissions/about-editing-ip-allow-list-entries.md,broken liquid tags +translations/zh-CN/data/reusables/identity-and-permissions/about-enabling-allowed-ip-addresses.md,broken liquid tags +translations/zh-CN/data/reusables/identity-and-permissions/ip-allow-lists-githubapps-enterprise.md,broken liquid tags translations/zh-CN/data/reusables/identity-and-permissions/vigilant-mode-beta-note.md,rendering error translations/zh-CN/data/reusables/large_files/storage_assets_location.md,broken liquid tags translations/zh-CN/data/reusables/large_files/use_lfs_tip.md,rendering error @@ -1202,7 +1151,6 @@ translations/zh-CN/data/reusables/pages/emu-org-only.md,broken liquid tags translations/zh-CN/data/reusables/pages/sidebar-pages.md,rendering error translations/zh-CN/data/reusables/projects/enable-basic-workflow.md,broken liquid tags translations/zh-CN/data/reusables/projects/graphql-ghes.md,rendering error -translations/zh-CN/data/reusables/projects/projects-filters.md,broken liquid tags translations/zh-CN/data/reusables/pull_requests/configure_pull_request_merges_intro.md,rendering error translations/zh-CN/data/reusables/pull_requests/default_merge_option.md,rendering error translations/zh-CN/data/reusables/pull_requests/pull_request_merges_and_contributions.md,rendering error diff --git a/translations/zh-CN/content/actions/migrating-to-github-actions/automating-migration-with-github-actions-importer.md b/translations/zh-CN/content/actions/migrating-to-github-actions/automating-migration-with-github-actions-importer.md new file mode 100644 index 0000000000..9ef8bc448b --- /dev/null +++ b/translations/zh-CN/content/actions/migrating-to-github-actions/automating-migration-with-github-actions-importer.md @@ -0,0 +1,240 @@ +--- +title: Automating migration with GitHub Actions Importer +intro: 'Use {% data variables.product.prodname_actions_importer %} to plan and automate your migration to {% data variables.product.prodname_actions %}.' +versions: + fpt: '*' + ghec: '*' + ghes: '*' + ghae: '*' +type: how_to +miniTocMaxHeadingLevel: 3 +topics: + - Migration + - CI + - CD +shortTitle: Automate migration with {% data variables.product.prodname_actions_importer %} +--- + +{% data reusables.actions.enterprise-beta %} +{% data reusables.actions.enterprise-github-hosted-runners %} + +[Legal notice](#legal-notice) + +{% note %} + +**Note**: {% data variables.product.prodname_actions_importer %} is currently available as a public preview. Visit the [sign up page](https://github.com/features/actions-importer/signup) to request access to the preview. Once you are granted access you'll be able to use the `gh-actions-importer` CLI extension + +{% endnote %} + +## About {% data variables.product.prodname_actions_importer %} + +You can use {% data variables.product.prodname_actions_importer %} to plan and automatically migrate your CI/CD pipelines to {% data variables.product.prodname_actions %} from Azure DevOps, CircleCI, GitLab, Jenkins, and Travis CI. + +{% data variables.product.prodname_actions_importer %} is distributed as a Docker container, and uses a [{% data variables.product.prodname_dotcom %} CLI](https://cli.github.com) extension to interact with the container. + +Any workflow that is converted by the {% data variables.product.prodname_actions_importer %} should be inspected for correctness before using it as a production workload. The goal is to achieve an 80% conversion rate for every workflow, however, the actual conversion rate will depend on the makeup of each individual pipeline that is converted. + +## Supported CI platforms + +You can use {% data variables.product.prodname_actions_importer %} to migrate from the following platforms: + +- Azure DevOps +- CircleCI +- GitLab +- Jenkins +- Travis CI + +Once you are granted access to the preview, you will be able to access further reference documentation for each of the supported platforms. + +## Prerequisites + +{% data variables.product.prodname_actions_importer %} has the following requirements: + +- You must have been granted access to the public preview for the {% data variables.product.prodname_actions_importer %}. +{%- ifversion ghes < 3.5 or ghae %} +- Use a {% data variables.product.pat_generic %} with the `read:packages` scope enabled. +{%- else %} +- You must have credentials to authenticate to the {% data variables.product.prodname_registry %} {% data variables.product.prodname_container_registry %}. For more information, see "[Working with the Container registry](/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry)." +{% endif %} +- An environment where you can run Linux-based containers, and can install the necessary tools. + - Docker is [installed](https://docs.docker.com/get-docker/) and running. + - [{% data variables.product.prodname_dotcom %} CLI](https://cli.github.com) is installed. + + {% note %} + + **Note**: The {% data variables.product.prodname_actions_importer %} container and CLI do not need to be installed on the same server as your CI platform. + + {% endnote %} + +### Installing the {% data variables.product.prodname_actions_importer %} CLI extension + +1. Install the {% data variables.product.prodname_actions_importer %} CLI extension: + + ```bash + $ gh extension install github/gh-actions-importer + ``` +1. Verify that the extension is installed: + + ```bash + $ gh actions-importer -h + Options: + -?, -h, --help Show help and usage information + + Commands: + update Update to the latest version of the GitHub Actions Importer. + version Display the version of the GitHub Actions Importer. + configure Start an interactive prompt to configure credentials used to authenticate with your CI server(s). + audit Plan your CI/CD migration by analyzing your current CI/CD footprint. + forecast Forecast GitHub Actions usage from historical pipeline utilization. + dry-run Convert a pipeline to a GitHub Actions workflow and output its yaml file. + migrate Convert a pipeline to a GitHub Actions workflow and open a pull request with the changes. + ``` + +### Updating the {% data variables.product.prodname_actions_importer %} CLI + +To ensure you're running the latest version of {% data variables.product.prodname_actions_importer %}, you should regularly run the `update` command: + +```bash +$ gh actions-importer update +``` + +You must be authenticated with the {% data variables.product.prodname_container_registry %} for this command to be successful. Alternatively, you can provide credentials using the `--username` and `--password-stdin` parameters: + +```bash +$ echo $GITHUB_TOKEN | gh actions-importer update --username $GITHUB_HANDLE --password-stdin +``` + +### Authenticating at the command line + +You must configure credentials that allow {% data variables.product.prodname_actions_importer %} to communicate with {% data variables.product.prodname_dotcom %} and your current CI server. You can configure these credentials using environment variables or a `.env.local` file. The environment variables can be configured in an interactive prompt, by running the following command: + +```bash +$ gh actions-importer configure +``` + +Once you are granted access to the preview, you will be able to access further reference documentation about using environment variables. + +## Using the {% data variables.product.prodname_actions_importer %} CLI + +Use the subcommands of `gh actions-importer` to begin your migration to {% data variables.product.prodname_actions %}, including `audit`, `forecast`, `dry-run`, and `migrate`. + +### Auditing your existing CI pipelines + +The `audit` subcommand can be used to plan your CI/CD migration by analyzing your current CI/CD footprint. This analysis can be used to plan a timeline for migrating to {% data variables.product.prodname_actions %}. + +To run an audit, use the following command to determine your available options: + +```bash +$ gh actions-importer audit -h +Description: + Plan your CI/CD migration by analyzing your current CI/CD footprint. + +[...] + +Commands: + azure-devops An audit will output a list of data used in an Azure DevOps instance. + circle-ci An audit will output a list of data used in a CircleCI instance. + gitlab An audit will output a list of data used in a GitLab instance. + jenkins An audit will output a list of data used in a Jenkins instance. + travis-ci An audit will output a list of data used in a Travis CI instance. +``` + +Once you are granted access to the preview, you will be able to access further reference documentation about running an audit. + +### Forecasting usage + +The `forecast` subcommand reviews historical pipeline usage to create a forecast of {% data variables.product.prodname_actions %} usage. + +To run a forecast, use the following command to determine your available options: + +```bash +$ gh actions-importer forecast -h +Description: + Forecasts GitHub Actions usage from historical pipeline utilization. + +[...] + +Commands: + azure-devops Forecasts GitHub Actions usage from historical Azure DevOps pipeline utilization. + jenkins Forecasts GitHub Actions usage from historical Jenkins pipeline utilization. + gitlab Forecasts GitHub Actions usage from historical GitLab pipeline utilization. + circle-ci Forecasts GitHub Actions usage from historical CircleCI pipeline utilization. + travis-ci Forecasts GitHub Actions usage from historical Travis CI pipeline utilization. + github Forecasts GitHub Actions usage from historical GitHub pipeline utilization. +``` + +Once you are granted access to the preview, you will be able to access further reference documentation about running a forecast. + +### Testing the migration process + +The `dry-run` subcommand can be used to convert a pipeline to its {% data variables.product.prodname_actions %} equivalent, and then write the workflow to your local filesystem. + +To perform a dry run, use the following command to determine your available options: + +```bash +$ gh actions-importer dry-run -h +Description: + Convert a pipeline to a GitHub Actions workflow and output its yaml file. + +[...] + +Commands: + azure-devops Convert an Azure DevOps pipeline to a GitHub Actions workflow and output its yaml file. + circle-ci Convert a CircleCI pipeline to GitHub Actions workflows and output the yaml file(s). + gitlab Convert a GitLab pipeline to a GitHub Actions workflow and output the yaml file. + jenkins Convert a Jenkins job to a GitHub Actions workflow and output its yaml file. + travis-ci Convert a Travis CI pipeline to a GitHub Actions workflow and output its yaml file. +``` + +Once you are granted access to the preview, you will be able to access further reference documentation about performing a dry run. + +### Migrating a pipeline to {% data variables.product.prodname_actions %} + +The `migrate` subcommand can be used to convert a pipeline to its GitHub Actions equivalent and then create a pull request with the contents. + +To run a migration, use the following command to determine your available options: + +```bash +$ gh actions-importer migrate -h +Description: + Convert a pipeline to a GitHub Actions workflow and open a pull request with the changes. + +[...] + +Commands: + azure-devops Convert an Azure DevOps pipeline to a GitHub Actions workflow and open a pull request with the changes. + circle-ci Convert a CircleCI pipeline to GitHub Actions workflows and open a pull request with the changes. + gitlab Convert a GitLab pipeline to a GitHub Actions workflow and open a pull request with the changes. + jenkins Convert a Jenkins job to a GitHub Actions workflow and open a pull request with the changes. + travis-ci Convert a Travis CI pipeline to a GitHub Actions workflow and and open a pull request with the changes. +``` + +Once you are granted access to the preview, you will be able to access further reference documentation about running a migration. + +## Legal notice + +Portions have been adapted from https://github.com/github/gh-actions-importer/ under the MIT license: + +``` +MIT License + +Copyright (c) 2022 GitHub + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +``` diff --git a/translations/zh-CN/content/actions/using-github-hosted-runners/about-github-hosted-runners.md b/translations/zh-CN/content/actions/using-github-hosted-runners/about-github-hosted-runners.md index d47babe64e..1cd11dbb8c 100644 --- a/translations/zh-CN/content/actions/using-github-hosted-runners/about-github-hosted-runners.md +++ b/translations/zh-CN/content/actions/using-github-hosted-runners/about-github-hosted-runners.md @@ -111,7 +111,8 @@ Workflow logs list the runner used to run a job. For more information, see "[Vie ## Supported software -The software tools included in {% data variables.product.prodname_dotcom %}-hosted runners are updated weekly. The update process takes several days, and the list of preinstalled software on the `main` branch is updated after the whole deployment ends. +The software tools included in {% data variables.product.prodname_dotcom %}-hosted runners are updated weekly. The update process takes several days, and the list of preinstalled software on the `main` branch is updated after the whole deployment ends. + ### Preinstalled software Workflow logs include a link to the preinstalled tools on the exact runner. To find this information in the workflow log, expand the `Set up job` section. Under that section, expand the `Runner Image` section. The link following `Included Software` will describe the preinstalled tools on the runner that ran the workflow. diff --git a/translations/zh-CN/content/actions/using-workflows/caching-dependencies-to-speed-up-workflows.md b/translations/zh-CN/content/actions/using-workflows/caching-dependencies-to-speed-up-workflows.md index a2a833a1a3..81f65dee6d 100644 --- a/translations/zh-CN/content/actions/using-workflows/caching-dependencies-to-speed-up-workflows.md +++ b/translations/zh-CN/content/actions/using-workflows/caching-dependencies-to-speed-up-workflows.md @@ -1,7 +1,7 @@ --- -title: Caching dependencies to speed up workflows +title: 缓存依赖项以加快工作流程 shortTitle: Cache dependencies -intro: 'To make your workflows faster and more efficient, you can create and use caches for dependencies and other commonly reused files.' +intro: 为了使工作流程更快、更高效,可以为依赖项及其他经常重复使用的文件创建和使用缓存。 redirect_from: - /github/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows - /actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows @@ -14,65 +14,69 @@ type: tutorial topics: - Workflows miniTocMaxHeadingLevel: 3 +ms.openlocfilehash: 380fe568e950a4dc388e8f811ecebd12f242c5df +ms.sourcegitcommit: 34d500fe45b362043b4b4685d6705a7bfb484d11 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/15/2022 +ms.locfileid: '148164378' --- +## 关于缓存工作流程依赖项 -## About caching workflow dependencies +工作流程运行通常在不同运行之间重新使用相同的输出或下载的依赖项。 例如,Maven、Gradle、npm 和 Yarn 等软件包和依赖项管理工具都会对下载的依赖项保留本地缓存。 -Workflow runs often reuse the same outputs or downloaded dependencies from one run to another. For example, package and dependency management tools such as Maven, Gradle, npm, and Yarn keep a local cache of downloaded dependencies. +{% data variables.product.prodname_dotcom %} 托管的运行器上的 {% ifversion fpt or ghec %} 作业在干净的运行器映像中启动,每次都必须下载依赖项,导致网络利用率提高、运行时间延长和成本增加。 {% endif %}为帮助加快重新创建依赖项等文件,{% data variables.product.prodname_dotcom %} 可以缓存你在工作流中经常使用的文件。 -{% ifversion fpt or ghec %} Jobs on {% data variables.product.prodname_dotcom %}-hosted runners start in a clean runner image and must download dependencies each time, causing increased network utilization, longer runtime, and increased cost. {% endif %}To help speed up the time it takes to recreate files like dependencies, {% data variables.product.prodname_dotcom %} can cache files you frequently use in workflows. +要缓存作业的依赖项,可以使用 {% data variables.product.prodname_dotcom %} 的 [`cache` 操作](https://github.com/actions/cache)。 该操作创建和还原由唯一键标识的缓存。 或者,如果要缓存下列包管理器,则使用其各自的 setup-* 操作需要最小配置并将为你创建和还原依赖项缓存。 -To cache dependencies for a job, you can use {% data variables.product.prodname_dotcom %}'s [`cache` action](https://github.com/actions/cache). The action creates and restores a cache identified by a unique key. Alternatively, if you are caching the package managers listed below, using their respective setup-* actions requires minimal configuration and will create and restore dependency caches for you. - -| Package managers | setup-* action for caching | +| 包管理器 | 用于缓存的 setup-* 操作 | |---|---| -| npm, Yarn, pnpm | [setup-node](https://github.com/actions/setup-node#caching-global-packages-data) | -| pip, pipenv, Poetry | [setup-python](https://github.com/actions/setup-python#caching-packages-dependencies) | -| Gradle, Maven | [setup-java](https://github.com/actions/setup-java#caching-packages-dependencies) | +| npm、Yarn、pnpm | [setup-node](https://github.com/actions/setup-node#caching-global-packages-data) | +| pip、pipenv、Poetry | [setup-python](https://github.com/actions/setup-python#caching-packages-dependencies) | +| Gradle、Maven | [setup-java](https://github.com/actions/setup-java#caching-packages-dependencies) | | RubyGems | [setup-ruby](https://github.com/ruby/setup-ruby#caching-bundle-install-automatically) | | Go `go.sum` | [setup-go](https://github.com/actions/setup-go#caching-dependency-files-and-build-outputs) | {% warning %} -**Warning**: {% ifversion fpt or ghec %}Be mindful of the following when using caching with {% data variables.product.prodname_actions %}: +警告:{% ifversion fpt or ghec %}将缓存与 {% data variables.product.prodname_actions %} 结合使用时,请注意以下几点: -* {% endif %}We recommend that you don't store any sensitive information in the cache. For example, sensitive information can include access tokens or login credentials stored in a file in the cache path. Also, command line interface (CLI) programs like `docker login` can save access credentials in a configuration file. Anyone with read access can create a pull request on a repository and access the contents of a cache. Forks of a repository can also create pull requests on the base branch and access caches on the base branch. +* {% endif %}建议不要在缓存中存储任何敏感信息。 例如,敏感信息可以包括存储在缓存路径的文件中的访问令牌或登录凭据。 此外,命令行接口 (CLI) 程序(例如 `docker login`)可以将访问凭据保存在配置文件中。 具有读取访问权限的任何人都可以在存储库上创建拉取请求并访问缓存的内容。 仓库的复刻也可在基本分支上创建拉取请求,并在基本分支上访问缓存。 {%- ifversion fpt or ghec %} -* When using self-hosted runners, caches from workflow runs are stored on {% data variables.product.company_short %}-owned cloud storage. A customer-owned storage solution is only available with {% data variables.product.prodname_ghe_server %}. +* 使用自托管运行器时,工作流运行中的缓存存储在 {% data variables.product.company_short %} 拥有的云存储上。 客户拥有的存储解决方案仅适用于 {% data variables.product.prodname_ghe_server %}。 {%- endif %} {% endwarning %} {% data reusables.actions.comparing-artifacts-caching %} -For more information on workflow run artifacts, see "[Persisting workflow data using artifacts](/github/automating-your-workflow-with-github-actions/persisting-workflow-data-using-artifacts)." +有关工作流运行工件的详细信息,请参阅“[使用工件持久保存工作流数据](/github/automating-your-workflow-with-github-actions/persisting-workflow-data-using-artifacts)”。 -## Restrictions for accessing a cache +## 访问缓存的限制 -Access restrictions provide cache isolation and security by creating a logical boundary between different branches or tags. -Workflow runs can restore caches created in either the current branch or the default branch (usually `main`). If a workflow run is triggered for a pull request, it can also restore caches created in the base branch, including base branches of forked repositories. For example, if the branch `feature-b` has the base branch `feature-a`, a workflow run triggered on a pull request would have access to caches created in the default `main` branch, the base `feature-a` branch, and the current `feature-b` branch. +访问限制通过在不同分支或标记之间创建逻辑边界来提供缓存隔离和安全性。 工作流运行可以还原在当前分支或默认分支(通常是 `main`)中创建的缓存。 如果为拉取请求触发了工作流运行,则它还可以还原在基分支中创建的缓存,包括分支存储库的基分支。 例如,如果分支 `feature-b` 具有基分支 `feature-a`,则对拉取请求触发的工作流运行将有权访问在默认 `main` 分支、`feature-a` 基分支和当前 `feature-b` 分支中创建的缓存。 -Workflow runs cannot restore caches created for child branches or sibling branches. For example, a cache created for the child `feature-b` branch would not be accessible to a workflow run triggered on the parent `main` branch. Similarly, a cache created for the `feature-a` branch with the base `main` would not be accessible to its sibling `feature-c` branch with the base `main`. Workflow runs also cannot restore caches created for different tag names. For example, a cache created for the tag `release-a` with the base `main` would not be accessible to a workflow run triggered for the tag `release-b` with the base `main`. +工作流运行无法还原为子分支或同级分支创建的缓存。 例如,在父分支 `feature-b` 上触发的工作流运行无法访问为子分支 `main` 创建的缓存。 例如,为 `feature-a` 分支(基分支为 `main`)创建的缓存无法供其同级 `feature-c` 分支(基分支为 `main`)访问。 工作流运行也不能还原为不同标记名称创建的缓存。 例如,针对标记 `release-b`(基分支为 `main`)触发的工作流无法访问为标记 `release-a`(基分支为 `main`)创建的缓存。 -When a cache is created by a workflow run triggered on a pull request, the cache is created for the merge ref (`refs/pull/.../merge`). Because of this, the cache will have a limited scope and can only be restored by re-runs of the pull request. It cannot be restored by the base branch or other pull requests targeting that base branch. +当缓存由对拉取请求触发的工作流运行创建时,会为合并引用 (`refs/pull/.../merge`) 创建缓存。 因此,缓存的范围有限,只能通过重新运行拉取请求来还原。 它不能由基分支或针对该基分支的其他拉取请求还原。 -Multiple workflow runs in a repository can share caches. A cache created for a branch in a workflow run can be accessed and restored from another workflow run for the same repository and branch. +存储库中的多个工作流运行可以共享缓存。 可以从同一存储库和分支的另一个工作流运行访问和还原为工作流运行中的分支创建的缓存。 -## Using the `cache` action +## 使用 `cache` 操作 -The [`cache` action](https://github.com/actions/cache) will attempt to restore a cache based on the `key` you provide. When the action finds a cache that _exactly_ matches the key, the action restores the cached files to the `path` you configure. -You can optionally provide a list of `restore-keys` to use in case the `key` doesn't match an existing cache. A list of `restore-keys` is useful when you are restoring a cache from another branch because `restore-keys` can _partially_ match cache keys. For more information about matching `restore-keys`, see "[Matching a cache key](#matching-a-cache-key)." +此 [`cache` 操作](https://github.com/actions/cache)将尝试根据你提供 `key` 的还原缓存。 当操作找到与键完全匹配的缓存时,该操作会将缓存的文件还原到你配置的 `path`。 +可以选择提供在 `key` 与现有缓存不匹配时要使用的 `restore-keys` 列表。 从另一个分支还原缓存时,`restore-keys` 列表非常有用,因为 `restore-keys` 可以部分匹配缓存键。 有关匹配 `restore-keys` 的详细信息,请参阅“[匹配缓存密钥](#matching-a-cache-key)”。 -If there is an exact match to the provided `key`, this is considered a cache hit. If no cache exactly matches the provided `key`, this is considered a cache miss. On a cache miss, the action automatically creates a new cache if the job completes successfully. The new cache will use the `key` you provided and contains the files you specify in `path`. For more information about how this is handled, see "[Cache hits and misses](#cache-hits-and-misses)." +如果与提供的 `key` 完全匹配,则这被视为缓存命中。 如果没有缓存与提供的 `key` 完全匹配,则这被视为缓存失误。 在缓存失误情况下,该操作会在作业成功完成时自动创建一个新缓存。 新缓存将使用你提供的 `key`,并包含你在 `path` 中指定的文件。 有关如何处理此问题的详细信息,请参阅“[缓存命中和缓存失误](#cache-hits-and-misses)”。 -You cannot change the contents of an existing cache. Instead, you can create a new cache with a new key. +不能更改现有缓存的内容。 相反,可以使用新键创建新缓存。 -### Input parameters for the `cache` action +### `cache` 操作的输入参数 -- `key`: **Required** The key created when saving a cache and the key used to search for a cache. It can be any combination of variables, context values, static strings, and functions. Keys have a maximum length of 512 characters, and keys longer than the maximum length will cause the action to fail. -- `path`: **Required** The path(s) on the runner to cache or restore. - - You can specify a single path, or you can add multiple paths on separate lines. For example: +- `key`:必要。保存缓存时创建的密钥和用于搜索缓存的密钥。 它可以是变量、上下文值、静态字符串和函数的任何组合。 密钥最大长度为 512 个字符,密钥长度超过最大长度将导致操作失败。 +- `path`:必要。运行器上用于缓存或还原的路径。 + - 可以指定单个路径,也可以在单独的行上添加多个路径。 例如: ``` - name: Cache Gradle packages @@ -82,9 +86,9 @@ You cannot change the contents of an existing cache. Instead, you can create a n ~/.gradle/caches ~/.gradle/wrapper ``` - - You can specify either directories or single files, and glob patterns are supported. - - You can specify absolute paths, or paths relative to the workspace directory. -- `restore-keys`: **Optional** A string containing alternative restore keys, with each restore key placed on a new line. If no cache hit occurs for `key`, these restore keys are used sequentially in the order provided to find and restore a cache. For example: + - 可以指定目录或单个文件,并且支持 glob 模式。 + - 可以指定绝对路径或相对于工作区目录的路径。 +- `restore-keys`:可选。包含备用还原键的字符串,每个还原键均放置在一个新行上。 如果 `key` 没有发生缓存命中,则按照提供的顺序依次使用这些还原键来查找和还原缓存。 例如: {% raw %} ```yaml @@ -95,28 +99,28 @@ You cannot change the contents of an existing cache. Instead, you can create a n ``` {% endraw %} -### Output parameters for the `cache` action +### `cache` 操作的输出参数 -- `cache-hit`: A boolean value to indicate an exact match was found for the key. +- `cache-hit`:表示找到了键的精确匹配项的布尔值。 -### Cache hits and misses -When `key` exactly matches an existing cache, it's called a _cache hit_, and the action restores the cached files to the `path` directory. +### 缓存命中和缓存失误 +当 `key` 完全匹配现有缓存时,被称为缓存命中,并且操作会将缓存的文件还原到 `path` 目录。 -When `key` doesn't match an existing cache, it's called a _cache miss_, and a new cache is automatically created if the job completes successfully. +当 `key` 不匹配现有缓存时,则被称为缓存失误,在作业成功完成时会自动创建一个新缓存。 -When a cache miss occurs, the action also searches your specified `restore-keys` for any matches: +发生缓存失误时,该操作还会搜索指定的 `restore-keys` 以查找任何匹配项: -1. If you provide `restore-keys`, the `cache` action sequentially searches for any caches that match the list of `restore-keys`. - - When there is an exact match, the action restores the files in the cache to the `path` directory. - - If there are no exact matches, the action searches for partial matches of the restore keys. When the action finds a partial match, the most recent cache is restored to the `path` directory. -1. The `cache` action completes and the next step in the job runs. -1. If the job completes successfully, the action automatically creates a new cache with the contents of the `path` directory. +1. 如果提供 `restore-keys`,`cache` 操作将按顺序搜索与 `restore-keys` 列表匹配的任何缓存。 + - 当存在精确匹配时,该操作会将缓存中的文件还原到 `path` 目录。 + - 如果没有精确匹配,操作将会搜索恢复键值的部分匹配。 当操作找到部分匹配时,最近的缓存将还原到 `path` 目录。 +1. `cache` 操作完成,作业中的下一个步骤运行。 +1. 如果作业成功完成,则操作将自动创建一个包含 `path` 目录内容的新缓存。 -For a more detailed explanation of the cache matching process, see "[Matching a cache key](#matching-a-cache-key)." +有关缓存匹配过程的更详细说明,请参阅“[匹配缓存键](#matching-a-cache-key)”。 -### Example using the `cache` action +### 使用 `cache` 操作的示例 -This example creates a new cache when the packages in `package-lock.json` file change, or when the runner's operating system changes. The cache key uses contexts and expressions to generate a key that includes the runner's operating system and a SHA-256 hash of the `package-lock.json` file. +此示例在 `package-lock.json` 文件中的包更改时,或运行器的操作系统更改时,创建一个新的缓存。 缓存键使用上下文和表达式生成一个键值,其中包括运行器的操作系统和 `package-lock.json` 文件的 SHA-256 哈希。 ```yaml{:copy} name: Caching with npm @@ -156,13 +160,13 @@ jobs: run: npm test ``` -### Using contexts to create cache keys +### 使用上下文创建缓存键 -A cache key can include any of the contexts, functions, literals, and operators supported by {% data variables.product.prodname_actions %}. For more information, see "[Contexts](/actions/learn-github-actions/contexts)" and "[Expressions](/actions/learn-github-actions/expressions)." +缓存键可以包括 {% data variables.product.prodname_actions %} 支持的任何上下文、函数、文本和运算符。 有关详细信息,请参阅“[上下文](/actions/learn-github-actions/contexts)”和“[表达式](/actions/learn-github-actions/expressions)”。 -Using expressions to create a `key` allows you to automatically create a new cache when dependencies change. +使用表达式创建 `key` 使你能够在依赖项更改时自动创建新缓存。 -For example, you can create a `key` using an expression that calculates the hash of an npm `package-lock.json` file. So, when the dependencies that make up the `package-lock.json` file change, the cache key changes and a new cache is automatically created. +例如,可以使用可计算 npm `package-lock.json` 文件的哈希的表达式创建 `key`。 因此,当构成 `package-lock.json` 文件的依赖项更改时,缓存键会更改,并自动创建新缓存。 {% raw %} ```yaml @@ -170,17 +174,17 @@ npm-${{ hashFiles('package-lock.json') }} ``` {% endraw %} -{% data variables.product.prodname_dotcom %} evaluates the expression `hash "package-lock.json"` to derive the final `key`. +{% data variables.product.prodname_dotcom %} 计算表达式 `hash "package-lock.json"` 以派生最终的 `key`。 ```yaml npm-d5ea0750 ``` -### Using the output of the `cache` action +### 使用 `cache` 操作的输出 -You can use the output of the `cache` action to do something based on whether a cache hit or miss occurred. When an exact match is found for a cache for the specified `key`, the `cache-hit` output is set to `true`. +可以使用 `cache` 操作的输出,以根据发生的是缓存命中还是缓存失误来执行某些操作。 找到指定 `key` 的缓存的精确匹配时,`cache-hit` 输出设置为 `true`。 -In the example workflow above, there is a step that lists the state of the Node modules if a cache miss occurred: +在上面的示例工作流中,有一个步骤会列出发生缓存失误时节点模块的状态: ```yaml - if: {% raw %}${{ steps.cache-npm.outputs.cache-hit != 'true' }}{% endraw %} @@ -189,15 +193,15 @@ In the example workflow above, there is a step that lists the state of the Node run: npm list ``` -## Matching a cache key +## 匹配缓存键 -The `cache` action first searches for cache hits for `key` and the cache _version_ in the branch containing the workflow run. If there is no hit, it searches for `restore-keys` and the _version_. If there are still no hits in the current branch, the `cache` action retries same steps on the default branch. Please note that the scope restrictions apply during the search. For more information, see "[Restrictions for accessing a cache](#restrictions-for-accessing-a-cache)." +`cache` 操作首先在包含工作流运行的分支中搜索 `key` 和缓存版本的缓存命中。 如果没有命中,它会搜索 `restore-keys` 和版本。 如果当前分支中仍然没有命中,`cache` 操作会在默认分支上重试相同步骤。 请注意,范围限制在搜索期间适用。 有关详细信息,请参阅“[访问缓存的限制](#restrictions-for-accessing-a-cache)”。 -Cache version is a way to stamp a cache with metadata of the `path` and the compression tool used while creating the cache. This ensures that the consuming workflow run uniquely matches a cache it can actually decompress and use. For more information, see [Cache Version](https://github.com/actions/cache#cache-version) in the Actions Cache documentation. +缓存版本是使用 `path` 元数据以及创建缓存时使用的压缩工具标记缓存的一种方法。 这可确保使用的工作流运行与它实际可以解压缩和使用的缓存唯一匹配。 有关详细信息,请参阅操作缓存文档中的[缓存版本](https://github.com/actions/cache#cache-version)。 -`restore-keys` allows you to specify a list of alternate restore keys to use when there is a cache miss on `key`. You can create multiple restore keys ordered from the most specific to least specific. The `cache` action searches the `restore-keys` in sequential order. When a key doesn't match directly, the action searches for keys prefixed with the restore key. If there are multiple partial matches for a restore key, the action returns the most recently created cache. +通过 `restore-keys`,你可以指定当 `key` 中发生缓存失误时要使用的备用还原键列表。 您可以创建从最具体到最不具体的多个恢复键。 `cache` 操作按顺序搜索 `restore-keys`。 当键不直接匹配时,操作将搜索以恢复键为前缀的键。 如果恢复键值有多个部分匹配项,操作将返回最近创建的缓存。 -### Example using multiple restore keys +### 使用多个恢复键值的示例 {% raw %} ```yaml @@ -208,7 +212,7 @@ restore-keys: | ``` {% endraw %} -The runner evaluates the expressions, which resolve to these `restore-keys`: +运行器将计算表达式,这些表达式解析为以下 `restore-keys`: {% raw %} ```yaml @@ -219,13 +223,13 @@ restore-keys: | ``` {% endraw %} -The restore key `npm-feature-` matches any key that starts with the string `npm-feature-`. For example, both of the keys `npm-feature-fd3052de` and `npm-feature-a9b253ff` match the restore key. The cache with the most recent creation date would be used. The keys in this example are searched in the following order: +还原键 `npm-feature-` 与以字符串 `npm-feature-` 开头的任何键匹配。 例如,`npm-feature-fd3052de` 和 `npm-feature-a9b253ff` 这两个键都与还原键匹配。 将使用创建日期最新的缓存。 此示例中的键值按以下顺序搜索: -1. **`npm-feature-d5ea0750`** matches a specific hash. -1. **`npm-feature-`** matches cache keys prefixed with `npm-feature-`. -1. **`npm-`** matches any keys prefixed with `npm-`. +1. `npm-feature-d5ea0750` 匹配特定哈希。 +1. `npm-feature-` 匹配前缀为 `npm-feature-` 的缓存键。 +1. `npm-` 匹配前缀为 `npm-` 的任何键。 -#### Example of search priority +#### 搜索优先级示例 ```yaml key: @@ -235,80 +239,76 @@ restore-keys: | npm- ``` -For example, if a pull request contains a `feature` branch and targets the default branch (`main`), the action searches for `key` and `restore-keys` in the following order: +例如,如果拉取请求包含 `feature` 分支,并以默认分支 (`main`) 为目标,则该操作将按以下顺序搜索 `key` 和 `restore-keys`: -1. Key `npm-feature-d5ea0750` in the `feature` branch -1. Key `npm-feature-` in the `feature` branch -1. Key `npm-` in the `feature` branch -1. Key `npm-feature-d5ea0750` in the `main` branch -1. Key `npm-feature-` in the `main` branch -1. Key `npm-` in the `main` branch +1. `feature` 分支中的键 `npm-feature-d5ea0750` +1. `feature` 分支中的键 `npm-feature-` +1. `feature` 分支中的键 `npm-` +1. `main` 分支中的键 `npm-feature-d5ea0750` +1. `main` 分支中的键 `npm-feature-` +1. `main` 分支中的键 `npm-` -## Usage limits and eviction policy +## 使用限制和收回政策 -{% data variables.product.prodname_dotcom %} will remove any cache entries that have not been accessed in over 7 days. There is no limit on the number of caches you can store, but the total size of all caches in a repository is limited{% ifversion actions-cache-policy-apis %}. By default, the limit is 10 GB per repository, but this limit might be different depending on policies set by your enterprise owners or repository administrators.{% else %} to 10 GB.{% endif %} +{% data variables.product.prodname_dotcom %} 将删除 7 天内未被访问的任何缓存条目。 可以存储的缓存数没有限制,但存储库中所有缓存的总大小限制{% ifversion actions-cache-policy-apis %}。 默认情况下,每个存储库的限制为 10 GB,但根据企业所有者或存储库管理员设置的策略,此限制可能有所不同。{% else %}为 10 GB。{% endif %} -{% data reusables.actions.cache-eviction-process %} {% ifversion actions-cache-ui %}The cache eviction process may cause cache thrashing, where caches are created and deleted at a high frequency. To reduce this, you can review the caches for a repository and take corrective steps, such as removing caching from specific workflows. For more information, see "[Managing caches](#managing-caches)."{% endif %}{% ifversion actions-cache-admin-ui %} You can also increase the cache size limit for a repository. For more information, see "[Managing {% data variables.product.prodname_actions %} settings for a repository](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#configuring-cache-storage-for-a-repository)." +{% data reusables.actions.cache-eviction-process %} {% ifversion actions-cache-ui %}缓存逐出过程可能会导致缓存抖动,即频繁地创建和删除缓存。 若要减少这种情况,可以查看存储库缓存并采取纠正措施,例如从特定工作流中删除缓存。 有关详细信息,请参阅“[管理缓存](#managing-caches)”。{% endif %}{% ifversion actions-cache-admin-ui %}还可以增加存储库的缓存大小限制。 有关详细信息,请参阅“[管理存储库的 {% data variables.product.prodname_actions %} 设置](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#configuring-cache-storage-for-a-repository)”。 {% elsif actions-cache-policy-apis %} -For information on changing the policies for the repository cache size limit, see "[Enforcing policies for {% data variables.product.prodname_actions %} in your enterprise](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise#enforcing-a-policy-for-cache-storage-in-your-enterprise)" and "[Managing {% data variables.product.prodname_actions %} settings for a repository](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#configuring-cache-storage-for-a-repository)." +有关更改存储库缓存大小限制的策略的信息,请参阅“[在企业中强制实施 {% data variables.product.prodname_actions %} 策略](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise#enforcing-a-policy-for-cache-storage-in-your-enterprise)”和“[管理存储库的 {% data variables.product.prodname_actions %} 设置](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#configuring-cache-storage-for-a-repository)”。 {% endif %} {% ifversion actions-cache-management %} -## Managing caches +## 管理缓存 {% ifversion actions-cache-ui %} -To manage caches created from your workflows, you can: +若要管理从工作流创建的缓存,可以: -- View a list of all cache entries for a repository. -- Filter and sort the list of caches using specific metadata such as cache size, creation time, or last accessed time. -- Delete cache entries from a repository. -- Monitor aggregate cache usage for repositories and organizations. +- 查看存储库的所有缓存条目的列表。 +- 使用特定元数据(如缓存大小、创建时间或上次访问时间)对缓存列表进行筛选和排序。 +- 从存储库中删除缓存条目。 +- 监视存储库和组织的聚合缓存使用情况。 -There are multiple ways to manage caches for your repositories: +可通过多种方式管理存储库缓存: -- Using the {% data variables.product.prodname_dotcom %} web interface, as shown below. -- Using the REST API. For more information, see the "[{% data variables.product.prodname_actions %} Cache](/rest/actions/cache)" REST API documentation. -- Installing a {% data variables.product.prodname_cli %} extension to manage your caches from the command line. For more information, see the [gh-actions-cache](https://github.com/actions/gh-actions-cache) extension. +- 使用 {% data variables.product.prodname_dotcom %} Web 界面,如下所示。 +- 使用 REST API。 有关详细信息,请参阅“[{% data variables.product.prodname_actions %} 缓存](/rest/actions/cache)”REST API 文档。 +- 安装 {% data variables.product.prodname_cli %} 扩展来从命令行管理缓存。 有关详细信息,请参阅 [gh-actions-cache](https://github.com/actions/gh-actions-cache) 扩展。 {% else %} -You can use the {% data variables.product.product_name %} REST API to manage your caches. {% ifversion actions-cache-list-delete-apis %}You can use the API to list and delete cache entries, and see your cache usage.{% elsif actions-cache-management %}At present, you can use the API to see your cache usage, with more functionality expected in future updates.{% endif %} For more information, see the "[{% data variables.product.prodname_actions %} Cache](/rest/actions/cache)" REST API documentation. +可以使用 {% data variables.product.product_name %} REST API 来管理缓存。 {% ifversion actions-cache-list-delete-apis %}可以使用 API 列出和删除缓存条目,并查看缓存使用情况。{% elsif actions-cache-management %}目前,可以使用 API 查看缓存使用情况,将来的更新中预期会有更多功能。{% endif %}有关详细信息,请参阅“[{% data variables.product.prodname_actions %} 缓存](/rest/actions/cache)”REST API 文档。 -You can also install a {% data variables.product.prodname_cli %} extension to manage your caches from the command line. For more information about the extension, see [the extension documentation](https://github.com/actions/gh-actions-cache#readme). For more information about {% data variables.product.prodname_cli %} extensions, see "[Using GitHub CLI extensions](/github-cli/github-cli/using-github-cli-extensions)." +你还可以安装 {% data variables.product.prodname_cli %} 扩展来从命令行管理缓存。 有关扩展的详细信息,请参阅[扩展文档](https://github.com/actions/gh-actions-cache#readme)。 有关 {% data variables.product.prodname_cli %} 扩展的详细信息,请参阅“[使用 GitHub CLI 扩展](/github-cli/github-cli/using-github-cli-extensions)”。 {% endif %} {% ifversion actions-cache-ui %} -### Viewing cache entries +### 查看缓存条目 -You can use the web interface to view a list of cache entries for a repository. In the cache list, you can see how much disk space each cache is using, when the cache was created, and when the cache was last used. +可以使用 Web 界面查看存储库的缓存条目列表。 在缓存列表中,可以看到每个缓存占用的磁盘空间量、创建缓存的时间以及上次使用缓存的时间。 -{% data reusables.repositories.navigate-to-repo %} -{% data reusables.repositories.actions-tab %} -{% data reusables.repositories.actions-cache-list %} -1. Review the list of cache entries for the repository. +{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.actions-tab %} {% data reusables.repositories.actions-cache-list %} +1. 查看存储库的缓存条目列表。 - * To search for cache entries used for a specific branch, click the **Branch** dropdown menu and select a branch. The cache list will display all of the caches used for the selected branch. - * To search for cache entries with a specific cache key, use the syntax `key: key-name` in the **Filter caches** field. The cache list will display caches from all branches where the key was used. + * 若要搜索用于特定分支的缓存条目,请单击“分支”下拉菜单并选择一个分支。 缓存列表将显示用于所选分支的所有缓存。 + * 若要搜索具有特定缓存键的缓存条目,请使用“筛选缓存”字段中的语法 `key: key-name`。 缓存列表将显示使用键的所有分支中的缓存。 - ![Screenshot of the list of cache entries](/assets/images/help/repository/actions-cache-entry-list.png) + ![缓存条目列表的屏幕截图](/assets/images/help/repository/actions-cache-entry-list.png) -### Deleting cache entries +### 删除缓存条目 -Users with `write` access to a repository can use the {% data variables.product.prodname_dotcom %} web interface to delete cache entries. +对存储库具有 `write` 权限的用户可以使用 {% data variables.product.prodname_dotcom %} Web 界面删除缓存条目。 -{% data reusables.repositories.navigate-to-repo %} -{% data reusables.repositories.actions-tab %} -{% data reusables.repositories.actions-cache-list %} -1. To the right of the cache entry you want to delete, click {% octicon "trash" aria-label="The trash icon" %}. +{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.actions-tab %} {% data reusables.repositories.actions-cache-list %} +1. 在要删除的缓存条目的右侧,单击 {% octicon "trash" aria-label="The trash icon" %}。 - ![Screenshot of the list of cache entries](/assets/images/help/repository/actions-cache-delete.png) + ![缓存条目列表的屏幕截图](/assets/images/help/repository/actions-cache-delete.png) {% endif %} diff --git a/translations/zh-CN/content/admin/configuration/configuring-your-enterprise/index.md b/translations/zh-CN/content/admin/configuration/configuring-your-enterprise/index.md index 9a43e7ec87..fa6b6606e5 100644 --- a/translations/zh-CN/content/admin/configuration/configuring-your-enterprise/index.md +++ b/translations/zh-CN/content/admin/configuration/configuring-your-enterprise/index.md @@ -33,18 +33,18 @@ children: - /troubleshooting-tls-errors - /configuring-time-synchronization - /command-line-utilities - - /restricting-network-traffic-to-your-enterprise + - /restricting-network-traffic-to-your-enterprise-with-an-ip-allow-list - /configuring-github-pages-for-your-enterprise - /configuring-host-keys-for-your-instance - /configuring-the-referrer-policy-for-your-enterprise - /configuring-custom-footers - /configuring-web-commit-signing shortTitle: Configure your enterprise -ms.openlocfilehash: 3cc7deccfdf71a0e339fca8055f0cd4b5027a32c -ms.sourcegitcommit: fb047f9450b41b24afc43d9512a5db2a2b750a2a +ms.openlocfilehash: 4f19ba9cd3207c34b7eb679fb62481e04185ad2c +ms.sourcegitcommit: c562c85cc75ffe1eb4e9595d8adc09ec71697ab1 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/11/2022 -ms.locfileid: '147409229' +ms.lasthandoff: 11/22/2022 +ms.locfileid: '148180110' --- diff --git a/translations/zh-CN/content/admin/configuration/configuring-your-enterprise/initializing-github-ae.md b/translations/zh-CN/content/admin/configuration/configuring-your-enterprise/initializing-github-ae.md index e4f70c36cb..3617a6a91b 100644 --- a/translations/zh-CN/content/admin/configuration/configuring-your-enterprise/initializing-github-ae.md +++ b/translations/zh-CN/content/admin/configuration/configuring-your-enterprise/initializing-github-ae.md @@ -1,6 +1,6 @@ --- -title: Initializing GitHub AE -intro: 'To get your enterprise ready to use, you can complete the initial configuration of {% data variables.product.product_name %}.' +title: 初始化 GitHub AE +intro: '要让您的企业准备好使用,您可以完成 {% data variables.product.product_name %} 的初始配置。' versions: ghae: '*' type: how_to @@ -9,122 +9,127 @@ topics: redirect_from: - /admin/configuration/initializing-github-ae - /enterprise-server@latest/admin/configuration/configuring-your-enterprise/initializing-github-ae +ms.openlocfilehash: a3c32a770bbf58be3589824302fe3a32be0e239a +ms.sourcegitcommit: ced661bdffebd0f96f6f76db109fbe31983448ba +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/16/2022 +ms.locfileid: '148167050' --- -## About initialization +## 关于初始化 -Before you can initialize your enterprise, you must purchase {% data variables.product.product_name %}. For more information, contact {% data variables.contact.contact_enterprise_sales %}. +在初始化企业之前,必须购买 {% data variables.product.product_name %}。 更多信息请联系 {% data variables.contact.contact_enterprise_sales %}。 -{% data reusables.github-ae.initialize-enterprise %} Make sure the information you provide matches the intended enterprise owner's information in the IdP. For more information about enterprise owners, see "[Roles in an enterprise](/admin/user-management/managing-users-in-your-enterprise/roles-in-an-enterprise#enterprise-owner)." +{% data reusables.github-ae.initialize-enterprise %} 确保您提供的信息与 IdP 中的预期企业所有者信息相匹配。 有关企业所有者的详细信息,请参阅“[企业中的角色](/admin/user-management/managing-users-in-your-enterprise/roles-in-an-enterprise#enterprise-owner)”。 {% note %} -**Notes**: +**注释**: -- If the initial password for {% data variables.product.prodname_ghe_managed %} expires before you finish initialization, you can request a password reset at any time from your invitation email. +- 如果 {% data variables.product.prodname_ghe_managed %} 的初始密码在您完成初始化之前过期,您可以随时从邀请电子邮件请求重置密码。 -- Store the initial username and password for {% data variables.product.prodname_ghe_managed %} securely in a password manager. {% data reusables.saml.contact-support-if-your-idp-is-unavailable %} +- 将 {% data variables.product.prodname_ghe_managed %} 的初始用户名和密码安全地存储在密码管理器中。 {% data reusables.saml.contact-support-if-your-idp-is-unavailable %} {% endnote %} -During initialization, the enterprise owner will name your enterprise, configure SAML SSO, create policies for all organizations in your enterprise, and configure a support contact for your users. +在初始化期间,企业所有者将命名企业、配置 SAML SSO、为企业中的所有组织创建策略以及为用户配置支持联系人。 -## Prerequisites +## 先决条件 -To begin initialization, you will receive an invitation email from {% data variables.product.company_short %}. Before you configure {% data variables.product.prodname_ghe_managed %}, review the following prerequisites. +要开始初始化,您将收到来自 {% data variables.product.company_short %} 的邀请电子邮件。 在配置 {% data variables.product.prodname_ghe_managed %} 之前,要查看以下先决条件。 -To initialize {% data variables.location.product_location %}, you must have a SAML identity provider (IdP). {% data reusables.saml.ae-uses-saml-sso %} To connect your IdP to your enterprise during initialization, you should have your IdP's Entity ID (SSO) URL, Issuer ID URL, and public signing certificate (Base64-encoded). For more information, see "[About identity and access management for your enterprise](/admin/authentication/about-identity-and-access-management-for-your-enterprise)." +要初始化 {% data variables.location.product_location %},必须具有 SAML 标识提供者 (Idp)。 {% data reusables.saml.ae-uses-saml-sso %} 在初始化过程中将您的 IdP 连接到企业,您应该具有您的 IdP 实体 ID (SSO) URL、发行者 ID URL 和公共签名证书(Base64 编码)。 有关详细信息,请参阅“[关于企业标识和访问管理](/admin/authentication/about-identity-and-access-management-for-your-enterprise)”。 {% note %} -**Note**: {% data reusables.saml.create-a-machine-user %} +**注意**:{% data reusables.saml.create-a-machine-user %} {% endnote %} -## Signing in and naming your enterprise +## 登录并命名企业 -1. Follow the instructions in your welcome email to reach your enterprise. -2. Type your credentials under "Change password", then click **Change password**. -3. Under "What would you like your enterprise account to be named?", type the enterprise's name, then click **Save and continue**. - !["Save and continue" button for naming an enterprise](/assets/images/enterprise/configuration/ae-enterprise-configuration.png) +1. 按照欢迎电子邮件中的说明联系您的企业。 +2. 在“更改密码”下键入你的凭据,然后单击“更改密码”。 +3. 在“你希望将企业帐户命名为什么?”下,键入企业的名称,然后单击“保存并继续”。 + ![“保存并继续”按钮,用于命名企业](/assets/images/enterprise/configuration/ae-enterprise-configuration.png) -## Connecting your IdP to your enterprise +## 将 IdP 连接到企业 -To configure authentication for {% data variables.product.product_name %}, you must provide {% data variables.product.product_name %} with the details for your SAML IdP. {% data variables.product.company_short %} recommends using Azure AD as your IdP. For more information, see "[Configuring authentication and provisioning with your identity provider](/admin/authentication/configuring-authentication-and-provisioning-with-your-identity-provider)." +要配置 {% data variables.product.product_name %} 的身份验证,您必须提供包含 SAML IdP 详细信息的 {% data variables.product.product_name %}。 {% data variables.product.company_short %} 建议使用 Azure AD 作为您的 IdP。 有关详细信息,请参阅“[使用标识提供者配置身份验证和预配](/admin/authentication/configuring-authentication-and-provisioning-with-your-identity-provider)”。 -1. To the right of "Set up your identity provider", click **Configure**. - !["Configure" button for IdP configuration](/assets/images/enterprise/configuration/ae-idp-configure.png) -1. Under "Sign on URL", copy and paste the URL for your SAML IdP. - ![Text field for SAML IdP's sign-on URL](/assets/images/enterprise/configuration/ae-idp-sign-on-url.png) -1. Under "Issuer", copy and paste the issuer URL for your SAML IdP. - ![Text field for SAML IdP's issuer URL](/assets/images/enterprise/configuration/ae-idp-issuer-url.png) -1. Under "Public certificate", copy and paste the public certificate for your SAML IdP. - ![Text field for SAML IdP's public certificate](/assets/images/enterprise/configuration/ae-idp-public-certificate.png) -1. Click **Test SAML configuration** to ensure that the information you've entered is correct. - !["Test SAML configuration" button](/assets/images/enterprise/configuration/ae-test-saml-configuration.png) -1. Click **Save**. - !["Save" button for IdP configuration](/assets/images/enterprise/configuration/ae-save.png) +1. 在“设置标识提供者”右侧,单击“配置”。 + ![IdP 配置的“配置”按钮](/assets/images/enterprise/configuration/ae-idp-configure.png) +1. 在“Sign on URL(登录 URL)”下,复制并粘贴 SAML IdP 的 URL。 + ![SAML IdP 登录 URL 的文本字段](/assets/images/enterprise/configuration/ae-idp-sign-on-url.png) +1. 在“Issuer(发行机构)”下,复制并粘贴 SAML IdP 的发行机构 URL。 + ![SAML IdP 的发行机构 URL 的文本字段](/assets/images/enterprise/configuration/ae-idp-issuer-url.png) +1. 在“Public certificate(公共证书)”下,复制并粘贴 SAML IdP 的公共证书。 + ![SAML IdP 公共证书的文本字段](/assets/images/enterprise/configuration/ae-idp-public-certificate.png) +1. 单击“测试 SAML 配置”,确保你输入的信息是正确的。 + ![“测试 SAML 配置”按钮](/assets/images/enterprise/configuration/ae-test-saml-configuration.png) +1. 单击“ **保存**”。 + ![用于 IdP 配置的“保存”按钮](/assets/images/enterprise/configuration/ae-save.png) 1. {% data reusables.saml.assert-the-administrator-attribute %} -## Setting your enterprise policies +## 设置企业策略 -Configuring policies will set limitations for repository and organization management for your enterprise. These can be reconfigured after the initialization process. +配置策略将为企业的仓库和组织管理设置限制。 这些可以在初始化过程后重新配置。 -1. To the right of "Set your enterprise policies", click **Configure**. - !["Configure" button for policies configuration](/assets/images/enterprise/configuration/ae-policies-configure.png) -2. Under "Default Repository Permissions", use the drop-down menu and click a default permissions level for repositories in your enterprise. If a person has multiple avenues of access to an organization, either individually, through a team, or as an organization member, the highest permission level overrides any lower permission levels. Optionally, to allow organizations within your enterprise to set their default repository permissions, click **No policy** - ![Drop-down menu for default repository permissions options](/assets/images/enterprise/configuration/ae-repository-permissions-menu.png) -3. Under "Repository creation", choose whether you want to allow members to create repositories. Optionally, to allow organizations within your enterprise to set permissions, click **No policy**. - !["Members can create repositories" button for enterprise policies configuration](/assets/images/enterprise/configuration/ae-repository-creation-permissions.png) -4. Under "Repository forking", choose whether to allow forking of private and internal repositories. Optionally, to allow organizations within your enterprise to set permissions, click **No policy** - ![Drop-down menu for repository forking permissions options](/assets/images/enterprise/configuration/ae-repository-forking-menu.png) -5. Under "Repository invitations", choose whether members or organization owners can invite collaborators to repositories. Optionally, to allow organizations within your enterprise to set permissions, click **No policy** - ![Drop-down menu for repository invitation permissions options](/assets/images/enterprise/configuration/ae-repository-invitations-menu.png) -6. Under "Default repository visibility", use the drop-down menu and click the default visibility setting for new repositories. - ![Drop-down menu for default repository visibility options](/assets/images/enterprise/configuration/ae-repository-visibility-menu.png) -7. Under "Users can create organizations", use the drop-down menu to enable or disable organization creation access for members of the enterprise. - ![Drop-down menu for organization creation permissions options](/assets/images/enterprise/configuration/ae-organization-creation-permissions-menu.png) -8. Under "Force pushes", use the drop-down menu and choose whether to allow or block force pushes. - ![Drop-down menu for force pushes configuration options](/assets/images/enterprise/configuration/ae-force-pushes-configuration-menu.png) -9. Under "Git SSH access", use the drop-down menu and choose whether to enable Git SSH access for all repositories in the enterprise. - ![Drop-down menu for Git SSH access options](/assets/images/enterprise/configuration/ae-git-ssh-access-menu.png) -10. Click **Save** - !["Save" button for enterprise policies configuration](/assets/images/enterprise/configuration/ae-save.png) -11. Optionally, to reset all selections, click "Reset to default policies". - ![Link to reset all default policies](/assets/images/enterprise/configuration/ae-reset-default-options.png) +1. 在“设置企业策略”右侧,单击“配置”。 + ![用于策略配置的“配置”按钮](/assets/images/enterprise/configuration/ae-policies-configure.png) +2. 在“Default Repository Permissions(默认仓库权限)”下,使用下拉菜单,并单击企业中仓库的默认权限级别。 如果某人可通过多种途径访问组织(个人访问、通过团队访问或作为组织成员访问),则最高的项目板权限级别将覆盖任何较低的权限级别。 (可选)若要允许企业内的组织设置其默认仓库权限,请单击“无策略” + ![默认仓库权限选项的下拉菜单](/assets/images/enterprise/configuration/ae-repository-permissions-menu.png) +3. 在“Repository creation(仓库创建)”下,选择是否允许会员创建仓库. (可选)若要允许企业内的组织设置权限,请单击“无策略”。 + ![用于企业策略配置的“成员可创建存储库”按钮](/assets/images/enterprise/configuration/ae-repository-creation-permissions.png) +4. 在“Repository forking(仓库复刻)”下,选择是否允许私有和内部仓库复刻。 (可选)若要允许企业内的组织设置权限,请单击“无策略” + ![存储库分支创建权限选项的下拉菜单](/assets/images/enterprise/configuration/ae-repository-forking-menu.png) +5. 在“Repository invitations(仓库邀请)”下,选择成员或组织所有者是否可以邀请合作者进入仓库。 (可选)若要允许企业内的组织设置权限,请单击“无策略” + ![存储库邀请权限选项的下拉菜单](/assets/images/enterprise/configuration/ae-repository-invitations-menu.png) +6. 在“Default repository visibility(默认仓库可见性)”下,使用下拉菜单并单击新仓库的默认可见性设置。 + ![默认存储库可见性选项的下拉菜单](/assets/images/enterprise/configuration/ae-repository-visibility-menu.png) +7. 在“Users can create organizations(用户可以创建组织)”下,使用下拉菜单来启用或禁用企业成员创建组织。 + ![组织创建权限选项的下拉菜单](/assets/images/enterprise/configuration/ae-organization-creation-permissions-menu.png) +8. 在“Force pushes(强制推送)”下,使用下拉菜单选择是允许还是阻止强制推送。 + ![强制推送配置选项的下拉菜单](/assets/images/enterprise/configuration/ae-force-pushes-configuration-menu.png) +9. 在“Git SSH access(Git SSH 访问)”下,使用下拉菜单并选择是否为企业中所有仓库启用 Git SSH 访问。 + ![Git SSH 访问选项的下拉菜单](/assets/images/enterprise/configuration/ae-git-ssh-access-menu.png) +10. 单击“保存” + ![用于企业策略配置的“保存”按钮](/assets/images/enterprise/configuration/ae-save.png) +11. (可选)要重置所有选项,请单击“Reset to default policies(重置为默认策略)”。 + ![重置所有默认策略的链接](/assets/images/enterprise/configuration/ae-reset-default-options.png) -## Setting your internal support contact +## 设置内部支持联系人 -You can configure the method your users will use to contact your internal support team. This can be reconfigured after the initialization process. +您可以配置用户联系内部支持团队的方法。 这可以在初始化过程后重新配置。 -1. To the right of "Internal support contact", click **Configure**. - !["Configure" button for internal support contact configuration](/assets/images/enterprise/configuration/ae-support-configure.png) -2. Under "Internal support contact", select the method for users of your enterprise to contact support, through a URL or an e-mail address. Then, type the support contact information. - ![Text field for internal support contact URL](/assets/images/enterprise/configuration/ae-support-link-url.png) -3. Click **Save**. - !["Save" button for enterprise support contact configuration](/assets/images/enterprise/configuration/ae-save.png) +1. 在“内部支持联系人”右侧,单击“配置”。 + ![用于内部支持联系人配置的“配置”按钮](/assets/images/enterprise/configuration/ae-support-configure.png) +2. 在“Internal support contact(内部支持联系人)”下,选择您企业的用户通过网址或电子邮件地址联系支持的方法。 然后,键入支持联系信息。 + ![内部支持联系人 URL 的文本字段](/assets/images/enterprise/configuration/ae-support-link-url.png) +3. 单击“ **保存**”。 + ![用于企业支持联系人配置的“保存”按钮](/assets/images/enterprise/configuration/ae-save.png) -## Setting your email settings +## 设置电子邮件设置 -Once this is initialized, you can reconfigure any settings after the initialization process. For more information, see "[Configuring email for notifications](/admin/configuration/configuring-email-for-notifications)." +一旦初始化,您便可在初始化过程后重新配置任何设置。 有关详细信息,请参阅“[配置邮件通知](/admin/configuration/configuring-email-for-notifications)”。 -1. To the right of "Configure email settings", click **Configure**. - !["Configure" button for email settings configuration](/assets/images/enterprise/configuration/ae-email-configure.png) -2. Select **Enable email**. This will enable both outbound and inbound email, however, for inbound email to work you will also need to configure your DNS settings. For more information, see "[Configuring DNS and firewall - settings to allow incoming emails](/admin/configuration/configuring-email-for-notifications#configuring-dns-and-firewall-settings-to-allow-incoming-emails)." - !["Enable" checkbox for email settings configuration](/assets/images/enterprise/configuration/ae-enable-email-configure.png) -3. Complete your email server settings: - - In the **Server address** field, type the address of your SMTP server. - - In the **Port** field, type the port that your SMTP server uses to send email. - - In the **Domain** field, type the domain name that your SMTP server will send with a HELO response, if any. - - In the **Authentication** dropdown, choose the type of encryption used by your SMTP server. - - In the **No-reply email address** field, type the email address to use in the From and To fields for all notification emails. +1. 在“配置电子邮件设置”右侧,单击“配置”。 + ![用于电子邮件设置配置的“配置”按钮](/assets/images/enterprise/configuration/ae-email-configure.png) +2. 选择“启用电子邮件”。 这将启用出站和入站电子邮件,但是,为使入站电子邮件运行,您还需要配置 DNS 设置。 有关详细信息,请参阅“[配置 DNS 和防火墙设置,以允许传入电子邮件](/admin/configuration/configuring-email-for-notifications#configuring-dns-and-firewall-settings-to-allow-incoming-emails)”。 + ![用于电子邮件设置配置的“启用”复选框](/assets/images/enterprise/configuration/ae-enable-email-configure.png) +3. 完成电子邮件服务器设置: + - 在“服务器地址”字段中,输入 SMTP 服务器的地址。 + - 在“端口”字段中,输入 SMTP 服务器用于发送电子邮件的端口。 + - 在“域”字段中,输入 SMTP 服务器将随 HELO 响应(如有)发送的域名。 + - 在“身份验证”下拉菜单中,选择 SMTP 服务器所使用的加密类型。 + - 在“无回复电子邮件地址”字段中,输入要在所有通知电子邮件的“发件人”和“收件人”字段中使用的电子邮件地址。 -4. If you want to discard all incoming emails that are addressed to the no-reply email address, select **Discard email addressed to the no-reply email address**. - !["Discard" checkbox for email settings configuration](/assets/images/enterprise/configuration/ae-discard-email.png) -5. Click **Test email settings**. - !["Test email settings" button for email settings configuration](/assets/images/enterprise/configuration/ae-test-email.png) -6. Under "Send test email to," type the email address where you want to send a test email, then click **Send test email**. - !["Send test email" button for email settings configuration](/assets/images/enterprise/configuration/ae-send-test-email.png) -7. Click **Save**. - !["Save" button for enterprise support contact configuration](/assets/images/enterprise/configuration/ae-save.png) +4. 如果想放弃发送到无回复电子邮件地址的所有传入电子邮件,请选中“放弃发送到无回复电子邮件地址的电子邮件”。 + ![用于电子邮件设置配置的“放弃”复选框](/assets/images/enterprise/configuration/ae-discard-email.png) +5. 单击“测试电子邮件设置”。 + ![用于邮件设置配置的“测试邮件设置”按钮](/assets/images/enterprise/configuration/ae-test-email.png) +6. 在“发送测试电子邮件到”下,请输入测试电子邮件要发送到的电子邮件地址,然后单击“发送测试电子邮件”。 + ![用于邮件设置配置的“发送测试电子邮件”按钮](/assets/images/enterprise/configuration/ae-send-test-email.png) +7. 单击“ **保存**”。 + ![用于企业支持联系人配置的“保存”按钮](/assets/images/enterprise/configuration/ae-save.png) diff --git a/translations/zh-CN/content/admin/configuration/configuring-your-enterprise/restricting-network-traffic-to-your-enterprise.md b/translations/zh-CN/content/admin/configuration/configuring-your-enterprise/restricting-network-traffic-to-your-enterprise.md deleted file mode 100644 index bfdd817cca..0000000000 --- a/translations/zh-CN/content/admin/configuration/configuring-your-enterprise/restricting-network-traffic-to-your-enterprise.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -title: Restricting network traffic to your enterprise -shortTitle: Restricting network traffic -intro: You can use an IP allow list to restrict access to your enterprise to connections from specified IP addresses. -versions: - ghae: '*' -type: how_to -topics: - - Access management - - Enterprise - - Fundamentals - - Networking - - Security -redirect_from: - - /admin/configuration/restricting-network-traffic-to-your-enterprise ---- -## About IP allow lists - -By default, authorized users can access your enterprise from any IP address. Enterprise owners can restrict access to assets owned by organizations in an enterprise account by configuring an allow list for specific IP addresses. {% data reusables.identity-and-permissions.ip-allow-lists-example-and-restrictions %} - -{% data reusables.identity-and-permissions.ip-allow-lists-cidr-notation %} - -{% data reusables.identity-and-permissions.ip-allow-lists-enable %} {% data reusables.identity-and-permissions.ip-allow-lists-enterprise %} - -You can also configure allowed IP addresses for an individual organization. For more information, see "[Managing allowed IP addresses for your organization](/organizations/keeping-your-organization-secure/managing-allowed-ip-addresses-for-your-organization)." - -By default, Azure network security group (NSG) rules leave all inbound traffic open on ports 22, 80, 443, and 25. Enterprise owners can contact {% data variables.contact.github_support %} to configure access restrictions for your instance. - -For instance-level restrictions using Azure NSGs, contact {% data variables.contact.github_support %} with the IP addresses that should be allowed to access your enterprise instance. Specify address ranges using the standard CIDR (Classless Inter-Domain Routing) format. {% data variables.contact.github_support %} will configure the appropriate firewall rules for your enterprise to restrict network access over HTTP, SSH, HTTPS, and SMTP. For more information, see "[Receiving help from {% data variables.contact.github_support %}](/admin/enterprise-support/receiving-help-from-github-support)." - -## Adding an allowed IP address - -{% data reusables.identity-and-permissions.about-adding-ip-allow-list-entries %} - -{% data reusables.enterprise-accounts.access-enterprise %} -{% data reusables.enterprise-accounts.settings-tab %} -{% data reusables.enterprise-accounts.security-tab %} -{% data reusables.identity-and-permissions.ip-allow-lists-add-ip %} -{% data reusables.identity-and-permissions.ip-allow-lists-add-description %} -{% data reusables.identity-and-permissions.ip-allow-lists-add-entry %} -{% data reusables.identity-and-permissions.check-ip-address %} - -## Allowing access by {% data variables.product.prodname_github_apps %} - -{% data reusables.identity-and-permissions.ip-allow-lists-githubapps-enterprise %} - -## Enabling allowed IP addresses - -{% data reusables.identity-and-permissions.about-enabling-allowed-ip-addresses %} - -{% data reusables.enterprise-accounts.access-enterprise %} -{% data reusables.enterprise-accounts.settings-tab %} -{% data reusables.enterprise-accounts.security-tab %} -1. Under "IP allow list", select **Enable IP allow list**. - ![Checkbox to allow IP addresses](/assets/images/help/security/enable-ip-allowlist-enterprise-checkbox.png) -4. Click **Save**. - -## Editing an allowed IP address - -{% data reusables.identity-and-permissions.about-editing-ip-allow-list-entries %} - -{% data reusables.enterprise-accounts.access-enterprise %} -{% data reusables.enterprise-accounts.settings-tab %} -{% data reusables.enterprise-accounts.security-tab %} -{% data reusables.identity-and-permissions.ip-allow-lists-edit-entry %} -{% data reusables.identity-and-permissions.ip-allow-lists-edit-ip %} -{% data reusables.identity-and-permissions.ip-allow-lists-edit-description %} -8. Click **Update**. -{% data reusables.identity-and-permissions.check-ip-address %} - -{% ifversion ip-allow-list-address-check %} -## Checking if an IP address is permitted - -{% data reusables.identity-and-permissions.about-checking-ip-address %} - -{% data reusables.enterprise-accounts.access-enterprise %} -{% data reusables.enterprise-accounts.settings-tab %} -{% data reusables.enterprise-accounts.security-tab %} -{% data reusables.identity-and-permissions.check-ip-address-step %} -{% endif %} - -## Deleting an allowed IP address - -{% data reusables.enterprise-accounts.access-enterprise %} -{% data reusables.enterprise-accounts.settings-tab %} -{% data reusables.enterprise-accounts.security-tab %} -{% data reusables.identity-and-permissions.ip-allow-lists-delete-entry %} -{% data reusables.identity-and-permissions.ip-allow-lists-confirm-deletion %} - -## Using {% data variables.product.prodname_actions %} with an IP allow list - -{% data reusables.actions.ip-allow-list-self-hosted-runners %} diff --git a/translations/zh-CN/content/admin/enterprise-management/configuring-clustering/initializing-the-cluster.md b/translations/zh-CN/content/admin/enterprise-management/configuring-clustering/initializing-the-cluster.md index d9f9b98dbc..9a573c66a9 100644 --- a/translations/zh-CN/content/admin/enterprise-management/configuring-clustering/initializing-the-cluster.md +++ b/translations/zh-CN/content/admin/enterprise-management/configuring-clustering/initializing-the-cluster.md @@ -1,6 +1,6 @@ --- -title: Initializing the cluster -intro: 'A {% data variables.product.prodname_ghe_server %} cluster must be set up with a license and initialized using the administrative shell (SSH).' +title: 初始化集群 +intro: '{% data variables.product.prodname_ghe_server %} 集群必须使用许可进行设置,并使用管理 shell (SSH) 进行初始化。' redirect_from: - /enterprise/admin/clustering/initializing-the-cluster - /enterprise/admin/enterprise-management/initializing-the-cluster @@ -11,46 +11,50 @@ type: how_to topics: - Clustering - Enterprise +ms.openlocfilehash: 91394d1d39301f77bc49a87012e04c3d5e9c3b60 +ms.sourcegitcommit: ced661bdffebd0f96f6f76db109fbe31983448ba +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/16/2022 +ms.locfileid: '148167070' --- {% data reusables.enterprise_clustering.clustering-requires-https %} -## Installing {% data variables.product.prodname_ghe_server %} +## 安装 {% data variables.product.prodname_ghe_server %} -1. On each cluster node, provision and install {% data variables.product.prodname_ghe_server %}. For more information, see "[Setting up a {% data variables.product.prodname_ghe_server %} instance](/enterprise/admin/guides/installation/setting-up-a-github-enterprise-server-instance)." -2. Using the administrative shell or DHCP, **only** configure the IP address of each node. Don't configure any other settings. +1. 在每个集群节点上,提供并安装 {% data variables.product.prodname_ghe_server %}。 有关详细信息,请参阅“[设置 {% data variables.product.prodname_ghe_server %} 实例](/enterprise/admin/guides/installation/setting-up-a-github-enterprise-server-instance)”。 +2. 使用管理 shell 或 DHCP,仅配置每个节点的 IP 地址。 不要配置任何其他设置。 -## Configuring the first node +## 配置第一个节点 -1. Connect to the node that will be designated as MySQL primary in `cluster.conf`. For more information, see "[About the cluster configuration file](/enterprise/admin/guides/clustering/initializing-the-cluster/#about-the-cluster-configuration-file)." -2. In your web browser, visit `https://:8443/setup/`. -{% data reusables.enterprise_installation.upload-a-license-file %} -{% data reusables.enterprise_installation.save-settings-in-web-based-mgmt-console %} -{% data reusables.enterprise_installation.instance-will-restart-automatically %} +1. 连接到将在 `cluster.conf` 中指定为 MySQL 主要节点的节点。 有关详细信息,请参阅“[关于群集配置文件](/enterprise/admin/guides/clustering/initializing-the-cluster/#about-the-cluster-configuration-file)”。 +2. 在 Web 浏览器中,访问 `https://:8443/setup/`。 +{% data reusables.enterprise_installation.upload-a-license-file %} {% data reusables.enterprise_installation.save-settings-in-web-based-mgmt-console %} {% data reusables.enterprise_installation.instance-will-restart-automatically %} -## Initializing the cluster +## 初始化集群 -To initialize the cluster, you need a cluster configuration file (`cluster.conf`). For more information, see "[About the cluster configuration file](/enterprise/admin/guides/clustering/initializing-the-cluster/#about-the-cluster-configuration-file)". +若要初始化群集,需要群集配置文件 (`cluster.conf`)。 有关详细信息,请参阅“[关于群集配置文件](/enterprise/admin/guides/clustering/initializing-the-cluster/#about-the-cluster-configuration-file)”。 -1. From the first node that was configured, run `ghe-cluster-config-init`. This will initialize the cluster if there are nodes in the cluster configuration file that are not configured. -2. Run `ghe-cluster-config-apply`. This will validate the `cluster.conf` file, apply the configuration to each node file and bring up the configured services on each node. +1. 从配置的第一个节点开始,运行 `ghe-cluster-config-init`。 如果集群配置文件中存在未配置的节点,此操作会初始化集群。 +2. 运行 `ghe-cluster-config-apply`。 这将验证 `cluster.conf` 文件、将配置应用于每个节点文件,并调出每个节点上已配置的服务。 -To check the status of a running cluster use the `ghe-cluster-status` command. +若要检查正在运行的群集的状态,请使用 `ghe-cluster-status` 命令。 -## About the cluster configuration file +## 关于集群配置文件 -The cluster configuration file (`cluster.conf`) defines the nodes in the cluster, and what services they run. -For more information, see "[About cluster nodes](/enterprise/admin/guides/clustering/about-cluster-nodes)." +群集配置文件 (`cluster.conf`) 会定义群集中的节点及其运行的服务。 +有关详细信息,请参阅“[关于群集节点](/enterprise/admin/guides/clustering/about-cluster-nodes)”。 -This example `cluster.conf` defines a cluster with 11 nodes. +此示例 `cluster.conf` 定义具有 11 个节点的群集。 - - Two nodes called `ghes-front-end-node-\*` run services responsible for responding to client requests. - - Three nodes called `ghes-database-node-\*` run services responsible for storage, retrieval, and replication of database data. - - Three nodes called `ghes-search-node-\*` run services responsible for search functionality. - - Three nodes called `ghes-storage-node-\*` run services responsible for storage, retrieval, and replication of data. + - 名为 `ghes-front-end-node-\*` 的两个节点运行负责响应客户端请求的服务。 + - 名为 `ghes-database-node-\*` 的三个节点运行负责存储、检索和复制数据库数据的服务。 + - 名为 `ghes-search-node-\*` 的三个节点运行负责搜索功能的服务。 + - 名为 `ghes-storage-node-\*` 的三个节点运行负责存储、检索和复制数据的服务。 -The names of the nodes can be any valid hostname you choose. The names are set as the hostname of each node, and will also be added to `/etc/hosts` on each node, so that the nodes are locally resolvable to each other. +节点的名称可以是您选择的任何有效主机名。 名称被设置为每个节点的主机名,并且还将添加到每个节点上的 `/etc/hosts` 中,以便节点可以在本地相互解析。 -Specify the first cluster node you configured as the MySQL primary via `mysql-server` and `mysql-master`. +通过 `mysql-server` 和 `mysql-master` 指定你配置为 MySQL 主要节点的第一个集群节点。 ```ini [cluster] @@ -155,7 +159,7 @@ Specify the first cluster node you configured as the MySQL primary via `mysql-se metrics-server = true ``` -Create the file `/data/user/common/cluster.conf` on the configured first node. For example, using `vim`: +在配置的第一个节点上创建文件 `/data/user/common/cluster.conf`。 例如,使用 `vim`: ```shell ghe-data-node-1:~$ sudo vim /data/user/common/cluster.conf diff --git a/translations/zh-CN/content/admin/github-actions/enabling-github-actions-for-github-enterprise-server/enabling-github-actions-with-minio-storage.md b/translations/zh-CN/content/admin/github-actions/enabling-github-actions-for-github-enterprise-server/enabling-github-actions-with-minio-storage.md new file mode 100644 index 0000000000..6336814ef8 --- /dev/null +++ b/translations/zh-CN/content/admin/github-actions/enabling-github-actions-for-github-enterprise-server/enabling-github-actions-with-minio-storage.md @@ -0,0 +1,49 @@ +--- +title: Enabling GitHub Actions with MinIO storage +intro: 'You can enable {% data variables.product.prodname_actions %} on {% data variables.product.prodname_ghe_server %} and use MinIO storage to store data generated by workflow runs.' +permissions: 'Site administrators can enable {% data variables.product.prodname_actions %} and configure enterprise settings.' +versions: + ghes: '*' +type: how_to +topics: + - Actions + - Enterprise + - Infrastructure + - Storage +redirect_from: + - /admin/github-actions/enabling-github-actions-with-minio-gateway-for-nas-storage + - /admin/github-actions/enabling-github-actions-for-github-enterprise-server/enabling-github-actions-with-minio-gateway-for-nas-storage +shortTitle: MinIO storage +--- + +## Prerequisites + +Before enabling {% data variables.product.prodname_actions %}, make sure you have completed the following steps: + +* Create your MinIO bucket for storing data generated by workflow runs. For more information about installing and configuring MinIO, see "[MinIO High Performance Object Storage](https://min.io/docs/minio/container/index.html)" and "[mc mb](https://min.io/docs/minio/linux/reference/minio-mc/mc-mb.html)" in the MinIO documentation. + + To avoid resource contention on the appliance, we recommend that MinIO be hosted separately from {% data variables.location.product_location %}. + + {% indented_data_reference reusables.actions.enterprise-s3-permission spaces=2 %} +{% data reusables.actions.enterprise-common-prereqs %} + +## Enabling {% data variables.product.prodname_actions %} with MinIO storage + +{% data reusables.enterprise_site_admin_settings.access-settings %} +{% data reusables.enterprise_site_admin_settings.management-console %} +{% data reusables.enterprise_management_console.actions %} +{% data reusables.actions.enterprise-enable-checkbox %} +1. Under "Artifact & Log Storage", select **Amazon S3**, and enter your storage bucket's details: + + * **AWS Service URL**: The URL to your MinIO service. For example, `https://my-minio.example:9000`. + * **AWS S3 Bucket**: The name of your S3 bucket. + * **AWS S3 Access Key** and **AWS S3 Secret Key**: The `MINIO_ACCESS_KEY` and `MINIO_SECRET_KEY` used for your MinIO instance. + + ![Radio button for selecting Amazon S3 Storage and fields for MinIO configuration](/assets/images/enterprise/management-console/actions-minio-s3-storage.png) +1. Under "Artifact & Log Storage", select **Force path style**. + + ![Checkbox to Force path style](/assets/images/enterprise/management-console/actions-minio-force-path-style.png) +{% data reusables.enterprise_management_console.test-storage-button %} +{% data reusables.enterprise_management_console.save-settings %} + +{% data reusables.actions.enterprise-postinstall-nextsteps %} diff --git a/translations/zh-CN/content/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/migrating-your-enterprise-to-github-actions.md b/translations/zh-CN/content/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/migrating-your-enterprise-to-github-actions.md index 58f812ba1b..1e666cb775 100644 --- a/translations/zh-CN/content/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/migrating-your-enterprise-to-github-actions.md +++ b/translations/zh-CN/content/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/migrating-your-enterprise-to-github-actions.md @@ -1,7 +1,7 @@ --- -title: Migrating your enterprise to GitHub Actions +title: 将企业迁移到 GitHub Actions shortTitle: Migrate to Actions -intro: 'Learn how to plan a migration to {% data variables.product.prodname_actions %} for your enterprise from another provider.' +intro: '了解如何规划从其他提供商迁移到企业的 {% data variables.product.prodname_actions %}。' versions: ghec: '*' ghes: '*' @@ -10,78 +10,83 @@ type: how_to topics: - Actions - Enterprise +ms.openlocfilehash: 332d8af7f1087626509a9c72751882ea11f3072f +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159790' --- +## 关于企业迁移到 {% data variables.product.prodname_actions %} -## About enterprise migrations to {% data variables.product.prodname_actions %} +要将企业从现有系统迁移到 {% data variables.product.prodname_actions %},您可以规划迁移、完成迁移和停用现有系统。 -To migrate your enterprise to {% data variables.product.prodname_actions %} from an existing system, you can plan the migration, complete the migration, and retire existing systems. +本指南介绍了迁移的具体注意事项。 有关向企业介绍 {% data variables.product.prodname_actions %} 的其他信息,请参阅“[向企业介绍 {% data variables.product.prodname_actions %}](/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/introducing-github-actions-to-your-enterprise)”。 -This guide addresses specific considerations for migrations. For additional information about introducing {% data variables.product.prodname_actions %} to your enterprise, see "[Introducing {% data variables.product.prodname_actions %} to your enterprise](/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/introducing-github-actions-to-your-enterprise)." +## 规划迁移 -## Planning your migration +在开始将企业迁移到 {% data variables.product.prodname_actions %} 之前,应确定将迁移哪些工作流程以及这些迁移将如何影响您的团队,然后规划如何以及何时完成迁移。 -Before you begin migrating your enterprise to {% data variables.product.prodname_actions %}, you should identify which workflows will be migrated and how those migrations will affect your teams, then plan how and when you will complete the migrations. +### 利用迁移专家 -### Leveraging migration specialists +{% data variables.product.company_short %} 可以帮助您进行迁移,并且您也可以购买 {% data variables.product.prodname_professional_services %}。 更多信息请联系您的专属代表或 {% data variables.contact.contact_enterprise_sales %}。 -{% data variables.product.company_short %} can help with your migration, and you may also benefit from purchasing {% data variables.product.prodname_professional_services %}. For more information, contact your dedicated representative or {% data variables.contact.contact_enterprise_sales %}. +### 确定和清点迁移目标 -### Identifying and inventorying migration targets +在迁移到 {% data variables.product.prodname_actions %} 之前,您需要全面了解企业在现有系统中使用的工作流程。 -Before you can migrate to {% data variables.product.prodname_actions %}, you need to have a complete understanding of the workflows being used by your enterprise in your existing system. +首先,创建企业内现有构建和发布工作流的清单,收集有关哪些工作流程正被使用但需要迁移以及哪些工作流程留在后面迁移的信息。 -First, create an inventory of the existing build and release workflows within your enterprise, gathering information about which workflows are being actively used and need to migrated and which can be left behind. +接下来,了解当前提供商与 {% data variables.product.prodname_actions %} 之间的区别。 这将帮助您评估迁移每个工作流程时遇到的任何困难,以及您的企业在哪些方面可能会遇到功能差异。 有关详细信息,请参阅“[迁移到 {% data variables.product.prodname_actions %}](/actions/migrating-to-github-actions)”。 -Next, learn the differences between your current provider and {% data variables.product.prodname_actions %}. This will help you assess any difficulties in migrating each workflow, and where your enterprise might experience differences in features. For more information, see "[Migrating to {% data variables.product.prodname_actions %}](/actions/migrating-to-github-actions)." +使用此信息,您将能够确定哪些工作流程要迁移到 {% data variables.product.prodname_actions %}。 -With this information, you'll be able to determine which workflows you can and want to migrate to {% data variables.product.prodname_actions %}. +### 确定迁移对团队的影响 -### Determine team impacts from migrations +当您更改企业中使用的工具时,会影响团队的工作方式。 您需要考虑将工作流从现有系统迁移到 {% data variables.product.prodname_actions %} 将如何影响开发人员的日常工作。 -When you change the tools being used within your enterprise, you influence how your team works. You'll need to consider how moving a workflow from your existing systems to {% data variables.product.prodname_actions %} will affect your developers' day-to-day work. +确定将受迁移影响的任何流程、集成和第三方工具,并为需要进行的任何更新制定计划。 -Identify any processes, integrations, and third-party tools that will be affected by your migration, and make a plan for any updates you'll need to make. +请考虑迁移可能会如何影响您的合规性问题。 例如,您现有的凭据扫描和安全分析工具是与 {% data variables.product.prodname_actions %} 一起使用,还是需要使用新工具? -Consider how the migration may affect your compliance concerns. For example, will your existing credential scanning and security analysis tools work with {% data variables.product.prodname_actions %}, or will you need to use new tools? +识别现有系统中的网关和检查,并验证是否可以使用 {% data variables.product.prodname_actions %} 实施它们。 -Identify the gates and checks in your existing system and verify that you can implement them with {% data variables.product.prodname_actions %}. +### 识别和验证迁移工具 -### Identifying and validating migration tools +自动迁移工具可以将企业的工作流程从现有系统的语法转换为 {% data variables.product.prodname_actions %} 所需的语法。 确定第三方工具或者联系您的专业代表或 {% data variables.contact.contact_enterprise_sales %},询问 {% data variables.product.company_short %} 可以提供的工具。 例如,可以使用 {% data variables.product.prodname_actions_importer %} 来规划 CI 管道、限定其范围以及将 CI 管道从各种受支持的服务迁移到 {% data variables.product.prodname_actions %}。 有关详细信息,请参阅“[使用 {% data variables.product.prodname_actions_importer %} 自动执行迁移](/actions/migrating-to-github-actions/automating-migration-with-github-actions-importer)”。 -Automated migration tools can translate your enterprise's workflows from the existing system's syntax to the syntax required by {% data variables.product.prodname_actions %}. Identify third-party tooling or contact your dedicated representative or {% data variables.contact.contact_enterprise_sales %} to ask about tools that {% data variables.product.company_short %} can provide. For example, you can use the {% data variables.product.prodname_actions_importer %} to plan, scope, and migrate your CI pipelines to {% data variables.product.prodname_actions %} from various supported services. For more information, see "[Automating migration with {% data variables.product.prodname_actions_importer %}](/actions/migrating-to-github-actions/automating-migration-with-github-actions-importer)." +确定用于自动执行迁移的工具后,请通过在某些测试工作流程上运行该工具并验证结果是否符合预期来验证该工具。 -After you've identified a tool to automate your migrations, validate the tool by running the tool on some test workflows and verifying that the results are as expected. +自动化工具应该能够迁移大部分工作流程,但您可能需要手动重写至少一小部分。 估计您需要完成的手动工作量。 -Automated tooling should be able to migrate the majority of your workflows, but you'll likely need to manually rewrite at least a small percentage. Estimate the amount of manual work you'll need to complete. +### 确定迁移方法 -### Deciding on a migration approach +确定最适合您的企业的迁移方法。 较小的团队可以使用“淘汰和替换”方法一次迁移所有工作流程。 对于大型企业,迭代方法可能更现实。 您可以选择让中央机构管理整个迁移过程,也可以要求各个团队通过迁移自己的工作流程进行自助服务。 -Determine the migration approach that will work best for your enterprise. Smaller teams may be able to migrate all their workflows at once, with a "rip-and-replace" approach. For larger enterprises, an iterative approach may be more realistic. You can choose to have a central body manage the entire migration or you can ask individual teams to self serve by migrating their own workflows. +我们建议采用将主动管理与自助服务相结合的迭代方法。 从一小群早期采用者开始,他们可以充当您的内部拥护者。 确定一些足够全面的工作流程,以代表您的业务广度。 与早期采用者合作,将这些工作流程迁移到 {% data variables.product.prodname_actions %},根据需要进行迭代。 这将让其他团队相信他们的工作流程也可以迁移。 -We recommend an iterative approach that combines active management with self service. Start with a small group of early adopters that can act as your internal champions. Identify a handful of workflows that are comprehensive enough to represent the breadth of your business. Work with your early adopters to migrate those workflows to {% data variables.product.prodname_actions %}, iterating as needed. This will give other teams confidence that their workflows can be migrated, too. +然后,使 {% data variables.product.prodname_actions %} 可供您的大型组织使用。 提供资源以帮助这些团队将自己的工作流程迁移到 {% data variables.product.prodname_actions %},并在现有系统将要停用时通知团队。 -Then, make {% data variables.product.prodname_actions %} available to your larger organization. Provide resources to help these teams migrate their own workflows to {% data variables.product.prodname_actions %}, and inform the teams when the existing systems will be retired. +最后,通知仍在使用旧系统的任何团队,以便在特定时间范围内完成迁移。 您可以指出其他团队的成功案例,以向他们保证迁移是可能的,也是可取的。 -Finally, inform any teams that are still using your old systems to complete their migrations within a specific timeframe. You can point to the successes of other teams to reassure them that migration is possible and desirable. +### 定义迁移计划 -### Defining your migration schedule +确定迁移方法后,请制定一个计划,说明每个团队何时将其工作流程迁移到 {% data variables.product.prodname_actions %}。 -After you decide on a migration approach, build a schedule that outlines when each of your teams will migrate their workflows to {% data variables.product.prodname_actions %}. +首先,确定您希望迁移完成的日期。 例如,您可以计划在与当前提供商的合同结束时完成迁移。 -First, decide the date you'd like your migration to be complete. For example, you can plan to complete your migration by the time your contract with your current provider ends. +然后,与您的团队合作,创建一个符合最后期限又不会牺牲团队目标的时间表。 查看业务的节奏以及您要求迁移的每个团队的工作负载。 与每个团队协调,了解他们的交付时间表,并制定一个计划,允许团队在不影响其交付能力的时间迁移其工作流程。 -Then, work with your teams to create a schedule that meets your deadline without sacrificing their team goals. Look at your business's cadence and the workload of each individual team you're asking to migrate. Coordinate with each team to understand their delivery schedules and create a plan that allows the team to migrate their workflows at a time that won't impact their ability to deliver. +## 迁移到 {% data variables.product.prodname_actions %} -## Migrating to {% data variables.product.prodname_actions %} +当您准备好开始迁移时,请使用上面计划的自动化工具和手动重写将现有工作流程转换为 {% data variables.product.prodname_actions %}。 -When you're ready to start your migration, translate your existing workflows to {% data variables.product.prodname_actions %} using the automated tooling and manual rewriting you planned for above. +您可能还希望维护现有系统中的旧构件,也许是通过编写脚本化进程来存档构件。 -You may also want to maintain old build artifacts from your existing system, perhaps by writing a scripted process to archive the artifacts. +## 停用现有系统 -## Retiring existing systems +迁移完成后,可以考虑停用现有系统。 -After your migration is complete, you can think about retiring your existing system. +您可能希望在一段时间内并行运行这两个系统,同时验证 {% data variables.product.prodname_actions %} 配置是否稳定,而不会降低开发人员的体验。 -You may want to run both systems side-by-side for some period of time, while you verify that your {% data variables.product.prodname_actions %} configuration is stable, with no degradation of experience for developers. - -Eventually, decommission and shut off the old systems, and ensure that no one within your enterprise can turn the old systems back on. +最终,停用并关闭旧系统,并确保企业内没有人可以重新打开旧系统。 diff --git a/translations/zh-CN/content/admin/guides.md b/translations/zh-CN/content/admin/guides.md index 49d68d1fa6..061430ab4b 100644 --- a/translations/zh-CN/content/admin/guides.md +++ b/translations/zh-CN/content/admin/guides.md @@ -63,7 +63,7 @@ includeGuides: - /admin/configuration/configuring-github-connect/enabling-unified-search-for-your-enterprise - /admin/configuration/initializing-github-ae - /admin/configuration/network-ports - - /admin/configuration/restricting-network-traffic-to-your-enterprise + - /admin/configuration/restricting-network-traffic-to-your-enterprise-with-an-ip-allow-list - /admin/configuration/site-admin-dashboard - /admin/configuration/troubleshooting-ssl-errors - /admin/configuration/using-github-enterprise-server-with-a-load-balancer @@ -147,11 +147,11 @@ includeGuides: - /admin/user-management/suspending-and-unsuspending-users - /admin/overview/creating-an-enterprise-account - /admin/user-management/managing-organizations-in-your-enterprise/restoring-a-deleted-organization -ms.openlocfilehash: 832e990d9b1c30895fce286f1357ef540a96af6f -ms.sourcegitcommit: 478f2931167988096ae6478a257f492ecaa11794 +ms.openlocfilehash: 88a0fe93a3c2784d81d81f91a3b1c0311cac84c7 +ms.sourcegitcommit: c562c85cc75ffe1eb4e9595d8adc09ec71697ab1 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/09/2022 -ms.locfileid: '147854122' +ms.lasthandoff: 11/22/2022 +ms.locfileid: '148180112' --- diff --git a/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/about-enterprise-managed-users.md b/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/about-enterprise-managed-users.md index ff7a0ab59b..59f87dab08 100644 --- a/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/about-enterprise-managed-users.md +++ b/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/about-enterprise-managed-users.md @@ -1,7 +1,7 @@ --- -title: '关于 {% data variables.product.prodname_emus %}' +title: About {% data variables.product.prodname_emus %} shortTitle: About managed users -intro: '可以从标识提供者的 {% data variables.product.prodname_dotcom %} 上集中管理企业成员的标识和访问。' +intro: 'You can centrally manage identity and access for your enterprise members on {% data variables.product.prodname_dotcom %} from your identity provider.' redirect_from: - /early-access/github/articles/get-started-with-managed-users-for-your-enterprise - /github/setting-up-and-managing-your-enterprise/managing-your-enterprise-users-with-your-identity-provider/about-enterprise-managed-users @@ -17,55 +17,50 @@ topics: - Enterprise - SSO allowTitleToDifferFromFilename: true -ms.openlocfilehash: 82a8b8c29ea38d57f0481146f2a857c2dcba8413 -ms.sourcegitcommit: d82f268a6f0236d1f4d2bf3d049974ada0170402 -ms.translationtype: HT -ms.contentlocale: zh-CN -ms.lasthandoff: 11/10/2022 -ms.locfileid: '148160726' --- -## 关于 {% data variables.product.prodname_emus %} -使用 {% data variables.product.prodname_emus %},可以通过标识提供者 (IdP) 控制企业成员的用户帐户。 IdP 中分配给 {% data variables.product.prodname_emu_idp_application %} 应用程序的用户将会预配为 {% data variables.product.prodname_dotcom %} 上的新用户帐户,并添加到企业中。 可以通过 IdP 控制用户帐户的用户名、配置文件数据、团队成员身份和存储库访问权限。 +## About {% data variables.product.prodname_emus %} -在 IdP 中,你可以为每个 {% data variables.enterprise.prodname_managed_user %} 提供用户、企业所有者或计费管理员的角色。 {% data variables.enterprise.prodname_managed_users_caps %} 可以拥有企业内的组织,并且可以将其他 {% data variables.enterprise.prodname_managed_users %} 添加到组织和其中的团队。 有关详细信息,请参阅“[企业中的角色](/github/setting-up-and-managing-your-enterprise/managing-users-in-your-enterprise/roles-in-an-enterprise)”和“[关于组织](/organizations/collaborating-with-groups-in-organizations/about-organizations)”。 +With {% data variables.product.prodname_emus %}, you can control the user accounts of your enterprise members through your identity provider (IdP). Users assigned to the {% data variables.product.prodname_emu_idp_application %} application in your IdP are provisioned as new user accounts on {% data variables.product.prodname_dotcom %} and added to your enterprise. You control usernames, profile data, team membership, and repository access for the user accounts from your IdP. + +In your IdP, you can give each {% data variables.enterprise.prodname_managed_user %} the role of user, enterprise owner, or billing manager. {% data variables.enterprise.prodname_managed_users_caps %} can own organizations within your enterprise and can add other {% data variables.enterprise.prodname_managed_users %} to the organizations and teams within. For more information, see "[Roles in an enterprise](/github/setting-up-and-managing-your-enterprise/managing-users-in-your-enterprise/roles-in-an-enterprise)" and "[About organizations](/organizations/collaborating-with-groups-in-organizations/about-organizations)." {% ifversion oidc-for-emu %} -{% data reusables.enterprise-accounts.emu-cap-validates %} 有关详细信息,请参阅“[关于对 IdP 的条件访问策略的支持](/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/about-support-for-your-idps-conditional-access-policy)”。 +{% data reusables.enterprise-accounts.emu-cap-validates %} For more information, see "[About support for your IdP's Conditional Access Policy](/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/about-support-for-your-idps-conditional-access-policy)." {% endif %} -可以授予 {% data variables.enterprise.prodname_managed_users %} 访问权限以及参与企业内部存储库的能力,但 {% data variables.enterprise.prodname_managed_users %} 无法创建公共内容,也不能与其他用户、组织和企业协作处理 {% data variables.product.prodname_dotcom %} 的其余部分。 有关详细信息,请参阅“[{% data variables.enterprise.prodname_managed_users %} 的功能和限制](#abilities-and-restrictions-of-enterprise-managed-users)”。 +You can grant {% data variables.enterprise.prodname_managed_users %} access to and the ability to contribute to repositories within your enterprise, but {% data variables.enterprise.prodname_managed_users %} cannot create public content or collaborate with other users, organizations, and enterprises on the rest of {% data variables.product.prodname_dotcom %}. For more information, see "[Abilities and restrictions of {% data variables.enterprise.prodname_managed_users %}](#abilities-and-restrictions-of-enterprise-managed-users)." -企业的 {% data variables.enterprise.prodname_managed_users %} 的用户名及其个人资料信息(例如显示名称和电子邮件地址)通过 IdP 设置,用户无法自行更改。 有关详细信息,请参阅“[用户名和个人资料信息](#usernames-and-profile-information)”。 +The usernames of your enterprise's {% data variables.enterprise.prodname_managed_users %} and their profile information, such as display names and email addresses, are set by through your IdP and cannot be changed by the users themselves. For more information, see "[Usernames and profile information](#usernames-and-profile-information)." -企业所有者可以在 {% data variables.product.prodname_dotcom %} 上审核所有 {% data variables.enterprise.prodname_managed_users %} 的操作。 有关详细信息,请参阅“[企业的审核日志事件](/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise#about-audit-log-events-for-your-enterprise)”。 +Enterprise owners can audit all of the {% data variables.enterprise.prodname_managed_users %}' actions on {% data variables.product.prodname_dotcom %}. For more information, see "[Audit log events for your enterprise](/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise#about-audit-log-events-for-your-enterprise)." -若要使用 {% data variables.product.prodname_emus %},需要启用了 {% data variables.product.prodname_emus %} 的单独企业帐户类型。 有关创建此帐户的详细信息,请参阅“[关于具有托管用户的企业](#about-enterprises-with-managed-users)”。 +To use {% data variables.product.prodname_emus %}, you need a separate type of enterprise account with {% data variables.product.prodname_emus %} enabled. For more information about creating this account, see "[About enterprises with managed users](#about-enterprises-with-managed-users)." {% note %} -注意:使用 {% data variables.product.prodname_ghe_cloud %} 进行标识和访问管理有多个选项,而 {% data variables.product.prodname_emus %} 并不是每个客户的最佳解决方案。 如需详细了解 {% data variables.product.prodname_emus %} 是否适合你的企业,请参阅“[关于企业身份验证](/admin/identity-and-access-management/managing-iam-for-your-enterprise/about-authentication-for-your-enterprise#identifying-the-best-authentication-method-for-your-enterprise)”。 +**Note:** There are multiple options for identity and access management with {% data variables.product.prodname_ghe_cloud %}, and {% data variables.product.prodname_emus %} is not the best solution for every customer. For more information about whether {% data variables.product.prodname_emus %} is right for your enterprise, see "[About authentication for your enterprise](/admin/identity-and-access-management/managing-iam-for-your-enterprise/about-authentication-for-your-enterprise#identifying-the-best-authentication-method-for-your-enterprise)." {% endnote %} -## 关于组织成员身份管理 +## About organization membership management -可手动管理组织成员身份,也可使用 IdP 组自动更新成员身份。 要通过 IdP 管理组织成员身份,必须将成员添加到 IdP 组,并且 IdP 组必须连接到组织内的团队。 有关自动管理组织和团队成员身份的详细信息,请参阅“[使用标识提供者组管理团队成员身份](/admin/identity-and-access-management/managing-iam-with-enterprise-managed-users/managing-team-memberships-with-identity-provider-groups)”。 +Organization memberships can be managed manually, or you can update memberships automatically using IdP groups. To manage organization memberships through your IdP, the members must be added to an IdP group, and the IdP group must be connected to a team within the organization. For more information about managing organization and team memberships automatically, see "[Managing team memberships with identity provider groups](/admin/identity-and-access-management/managing-iam-with-enterprise-managed-users/managing-team-memberships-with-identity-provider-groups)." -将成员添加到企业拥有的组织的方式(通过 IdP 组或手动)决定了必须如何从组织中删除他们。 +The way a member is added to an organization owned by your enterprise (through IdP groups or manually) determines how they must be removed from an organization. -- 如果将成员手动添加到组织,则必须手动将其删除。 从 IdP 上的 {% data variables.product.prodname_emu_idp_application %} 应用程序中取消分配他们,将暂停用户,但不会将其从组织中删除。 -- 如果用户由于被添加到映射到组织中的一个或多个团队的 IdP 组而成为该组织的成员,则从与组织关联的所有映射的 IdP 组中删除这些用户会将其从组织中删除。 +- If a member was added to an organization manually, you must remove them manually. Unassigning them from the {% data variables.product.prodname_emu_idp_application %} application on your IdP will suspend the user but not remove them from the organization. +- If a user became a member of an organization because they were added to IdP groups mapped to one or more teams in the organization, removing them from _all_ of the mapped IdP groups associated with the organization will remove them from the organization. -要了解成员是如何添加到组织中的,可以按类型筛选成员列表。 有关详细信息,请参阅[查看企业中的人员](/admin/user-management/managing-users-in-your-enterprise/viewing-people-in-your-enterprise#filtering-by-member-type-in-an-enterprise-with-managed-users)。 +To discover how a member was added to an organization, you can filter the member list by type. For more information, see "[Viewing people in your enterprise](/admin/user-management/managing-users-in-your-enterprise/viewing-people-in-your-enterprise#filtering-by-member-type-in-an-enterprise-with-managed-users)." -## 标识提供者支持 +## Identity provider support -{% data variables.product.prodname_emus %} 支持以下 IdP{% ifversion oidc-for-emu %} 和身份验证方法: +{% data variables.product.prodname_emus %} supports the following IdPs{% ifversion oidc-for-emu %} and authentication methods: -| | SAML | OIDC(beta 版本) | +| | SAML | OIDC | |----------------------------------|-----------------------------------------------|-----------------------------------------------| | Azure Active Directory | {% octicon "check" aria-label="Check icon" %} | {% octicon "check" aria-label="Check icon" %} | | Okta | {% octicon "check" aria-label="Check icon" %} | | @@ -75,36 +70,36 @@ ms.locfileid: '148160726' {% endif %} -## {% data variables.enterprise.prodname_managed_users %} 的功能和限制 +## Abilities and restrictions of {% data variables.enterprise.prodname_managed_users %} -{% data variables.enterprise.prodname_managed_users_caps %} 只能参与企业中的专用和内部存储库及其用户帐户拥有的专用存储库。 {% data variables.enterprise.prodname_managed_users_caps %} 对更广泛的 {% data variables.product.prodname_dotcom %} 社区具有只读访问权限。 这些针对用户和内容的可见性和访问限制适用于所有请求,包括 API 请求。 +{% data variables.enterprise.prodname_managed_users_caps %} can only contribute to private and internal repositories within their enterprise and private repositories owned by their user account. {% data variables.enterprise.prodname_managed_users_caps %} have read-only access to the wider {% data variables.product.prodname_dotcom %} community. These visibility and access restrictions for users and content apply to all requests, including API requests. -* 不能邀请 {% data variables.enterprise.prodname_managed_users_caps %} 加入企业外部的组织或存储库,也不能邀请 {% data variables.enterprise.prodname_managed_users %} 加入其他企业。 -* {% data variables.product.prodname_emus %} 不支持外部协作者。 -* {% data variables.enterprise.prodname_managed_users_caps %} 无法在企业外部的存储库中创建问题或拉取请求、添加评论或添加反应,也不能加注星标、监视或创建分支。 -* {% data variables.enterprise.prodname_managed_users_caps %} 可以查看 {% data variables.product.prodname_dotcom_the_website %} 上的所有公共存储库,但无法将代码推送到企业外部的存储库。 -* {% data variables.enterprise.prodname_managed_users_caps %} 和创建的内容只对企业的其他成员可见。 -* {% data variables.enterprise.prodname_managed_users_caps %} 无法关注企业外部的用户。 -* {% data variables.enterprise.prodname_managed_users_caps %} 无法创建 Gist 或对 Gist 添加评论。 -* {% data variables.enterprise.prodname_managed_users_caps %} 无法为 {% data variables.product.prodname_actions %} 创建入门工作流。 -* {% data variables.enterprise.prodname_managed_users_caps %} 无法在其用户帐户上安装 {% data variables.product.prodname_github_apps %}。 -* 其他 {% data variables.product.prodname_dotcom %} 用户无法查看、提及或邀请 {% data variables.enterprise.prodname_managed_user %} 进行协作。 -* 可以选择 {% data variables.enterprise.prodname_managed_users %} 是否能够创建其用户帐户拥有的存储库。 有关详细信息,请参阅“[在企业中实施存储库管理策略](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-repository-creation)”。 -* 如果允许 {% data variables.enterprise.prodname_managed_users %} 创建其用户帐户拥有的存储库,则他们只能拥有专用存储库,并且只能邀请其他企业成员协作处理其用户拥有的存储库。 +* {% data variables.enterprise.prodname_managed_users_caps %} cannot be invited to organizations or repositories outside of the enterprise, nor can the {% data variables.enterprise.prodname_managed_users %} be invited to other enterprises. +* Outside collaborators are not supported by {% data variables.product.prodname_emus %}. +* {% data variables.enterprise.prodname_managed_users_caps %} cannot create issues or pull requests in, comment or add reactions to, nor star, watch, or fork repositories outside of the enterprise. +* {% data variables.enterprise.prodname_managed_users_caps %} can view all public repositories on {% data variables.product.prodname_dotcom_the_website %}, but cannot push code to repositories outside of the enterprise. +* {% data variables.enterprise.prodname_managed_users_caps %} and the content they create is only visible to other members of the enterprise. +* {% data variables.enterprise.prodname_managed_users_caps %} cannot follow users outside of the enterprise. +* {% data variables.enterprise.prodname_managed_users_caps %} cannot create gists or comment on gists. +* {% data variables.enterprise.prodname_managed_users_caps %} cannot create starter workflows for {% data variables.product.prodname_actions %}. +* {% data variables.enterprise.prodname_managed_users_caps %} cannot install {% data variables.product.prodname_github_apps %} on their user accounts. +* Other {% data variables.product.prodname_dotcom %} users cannot see, mention, or invite a {% data variables.enterprise.prodname_managed_user %} to collaborate. +* You can choose whether {% data variables.enterprise.prodname_managed_users %} are able to create repositories owned by their user accounts. For more information, see "[Enforcing repository management policies in your enterprise](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-repository-creation)." +* If you allow {% data variables.enterprise.prodname_managed_users %} to create repositories owned by their user accounts, they can only own private repositories and can only invite other enterprise members to collaborate on their user-owned repositories. * {% data reusables.enterprise-accounts.emu-forks %} -* 只能在 {% data variables.enterprise.prodname_emu_enterprise %} 拥有的组织中创建专用和内部存储库,具体取决于组织和企业存储库可见性设置。 -* {% data variables.enterprise.prodname_managed_users_caps %} 在使用 {% data variables.product.prodname_pages %} 方面受到限制。 有关详细信息,请参阅“[关于 {% data variables.product.prodname_pages %}](/pages/getting-started-with-github-pages/about-github-pages#limitations-for-enterprise-managed-users)”。 +* Only private and internal repositories can be created in organizations owned by an {% data variables.enterprise.prodname_emu_enterprise %}, depending on organization and enterprise repository visibility settings. +* {% data variables.enterprise.prodname_managed_users_caps %} are limited in their use of {% data variables.product.prodname_pages %}. For more information, see "[About {% data variables.product.prodname_pages %}](/pages/getting-started-with-github-pages/about-github-pages#limitations-for-enterprise-managed-users)." * {% data reusables.copilot.emus-cannot-use-copilot %} -## {% data variables.product.prodname_emus %} 入门 +## Getting started with {% data variables.product.prodname_emus %} -必须先执行一系列配置步骤,开发人员才能将 {% data variables.product.prodname_ghe_cloud %} 与 {% data variables.product.prodname_emus %} 一起使用。 +Before your developers can use {% data variables.product.prodname_ghe_cloud %} with {% data variables.product.prodname_emus %}, you must follow a series of configuration steps. -1. 若要使用 {% data variables.product.prodname_emus %},需要启用了 {% data variables.product.prodname_emus %} 的单独企业帐户类型。 若要试用 {% data variables.product.prodname_emus %} 或讨论从现有企业迁移的选项,请联系 [{% data variables.product.prodname_dotcom %} 的销售团队](https://enterprise.github.com/contact)。 +1. To use {% data variables.product.prodname_emus %}, you need a separate type of enterprise account with {% data variables.product.prodname_emus %} enabled. To try out {% data variables.product.prodname_emus %} or to discuss options for migrating from your existing enterprise, please contact [{% data variables.product.prodname_dotcom %}'s Sales team](https://enterprise.github.com/contact). - GitHub 销售团队的联系人将与你合作创建新的 {% data variables.enterprise.prodname_emu_enterprise %}。 你需要为将设置企业的用户提供电子邮件地址,以及一个短代码,该代码将用作企业成员用户名的后缀。 {% data reusables.enterprise-accounts.emu-shortcode %} 有关详细信息,请参阅“[用户名和个人资料信息](#usernames-and-profile-information)”。 + Your contact on the GitHub Sales team will work with you to create your new {% data variables.enterprise.prodname_emu_enterprise %}. You'll need to provide the email address for the user who will set up your enterprise and a short code that will be used as the suffix for your enterprise members' usernames. {% data reusables.enterprise-accounts.emu-shortcode %} For more information, see "[Usernames and profile information](#usernames-and-profile-information)." -2. 创建企业后,你将收到来自 {% data variables.product.prodname_dotcom %} 的电子邮件,邀请你为企业的设置用户选择密码,该用户将是企业的第一个所有者。 设置密码时,请使用隐身或专用浏览窗口。 设置用户仅用于为企业配置单一登录和 SCIM 预配集成。 成功启用 SSO 后,设置用户将不再有权管理企业帐户。 设置用户的用户名是企业的短代码,后缀为 `_admin`。 +2. After we create your enterprise, you will receive an email from {% data variables.product.prodname_dotcom %} inviting you to choose a password for your enterprise's setup user, which will be the first owner in the enterprise. Use an incognito or private browsing window when setting the password. The setup user is only used to configure single sign-on and SCIM provisioning integration for the enterprise. It will no longer have access to administer the enterprise account once SSO is successfully enabled. The setup user's username is your enterprise's shortcode suffixed with `_admin`. {% note %} @@ -112,53 +107,54 @@ ms.locfileid: '148160726' {% endnote %} -3. 你以设置用户身份登录后,我们建议你启用双因素身份验证。 有关详细信息,请参阅“[配置双因素身份验证](/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication)”。 +3. After you log in as the setup user, we recommend enabling two-factor authentication. For more information, see "[Configuring two-factor authentication](/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication)." -1. 首先,请配置 {% ifversion oidc-for-emu %} 成员如何进行身份验证。 如果使用 Azure Active Directory 作为标识提供者,可以在 OpenID Connect (OIDC) 和安全断言标记语言 (SAML) 之间进行选择。 这两个选项都为成员提供无缝登录体验,但只有 OIDC 包括对条件访问策略 (CAP) 的支持。 如果使用 Okta 作为标识提供者,则可以使用 SAML 对成员进行身份验证。{% else %}SAML SSO 适用于企业。 有关详细信息,请参阅“[为 Enterprise 托管用户配置 SAML 单一登录](/admin/identity-and-access-management/managing-iam-with-enterprise-managed-users/configuring-saml-single-sign-on-for-enterprise-managed-users)”。{% endif %} +1. To get started, configure {% ifversion oidc-for-emu %}how your members will authenticate. If you are using Azure Active Directory as your identity provider, you can choose between OpenID Connect (OIDC) and Security Assertion Markup Language (SAML). We recommend OIDC, which includes support for Conditional Access Policies (CAP). If you require multiple enterprises with {% data variables.enterprise.prodname_managed_users %} provisioned from one tenant, you must use SAML for each enterprise after the first. If you are using Okta as your identity provider, you can use SAML to authenticate your members.{% else %}SAML SSO for your enterprise. For more information, see "[Configuring SAML single sign-on for Enterprise Managed Users](/admin/identity-and-access-management/managing-iam-with-enterprise-managed-users/configuring-saml-single-sign-on-for-enterprise-managed-users)."{% endif %} {% ifversion oidc-for-emu %} - 首先,请阅读所选身份验证方法的指南。 + To get started, read the guide for your chosen authentication method. - - “[为企业托管用户配置 OIDC](/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/configuring-oidc-for-enterprise-managed-users)”。 - - “[为企业托管用户配置 SAML 单一登录](/admin/identity-and-access-management/managing-iam-with-enterprise-managed-users/configuring-saml-single-sign-on-for-enterprise-managed-users)”。 + - "[Configuring OIDC for Enterprise Managed Users](/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/configuring-oidc-for-enterprise-managed-users)." + - "[Configuring SAML single sign-on for Enterprise Managed Users](/admin/identity-and-access-management/managing-iam-with-enterprise-managed-users/configuring-saml-single-sign-on-for-enterprise-managed-users)." {% endif %} -4. 配置 SSO 后,可以配置 SCIM 预配。 SCIM 是标识提供者在 {% data variables.product.prodname_dotcom_the_website %} 上创建 {% data variables.enterprise.prodname_managed_users %} 的方式。 有关配置 SCIM 预配的详细信息,请参阅“[为企业托管用户配置 SCIM 预配](/admin/identity-and-access-management/managing-iam-with-enterprise-managed-users/configuring-scim-provisioning-for-enterprise-managed-users)”。 +4. Once you have configured SSO, you can configure SCIM provisioning. SCIM is how your identity provider will create {% data variables.enterprise.prodname_managed_users %} on {% data variables.product.prodname_dotcom_the_website %}. For more information on configuring SCIM provisioning, see "[Configuring SCIM provisioning for enterprise managed users](/admin/identity-and-access-management/managing-iam-with-enterprise-managed-users/configuring-scim-provisioning-for-enterprise-managed-users)." -5. 配置身份验证和预配后,可以通过将 IdP 组与团队同步来开始管理 {% data variables.enterprise.prodname_managed_users %} 的组织成员身份。 有关详细信息,请参阅[使用标识提供者组管理团队成员身份](/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/managing-team-memberships-with-identity-provider-groups)。 +5. Once authentication and provisioning are configured, you can start managing organization membership for your {% data variables.enterprise.prodname_managed_users %} by synchronizing IdP groups with teams. For more information, see "[Managing team memberships with identity provider groups](/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/managing-team-memberships-with-identity-provider-groups)." -如果企业成员必须使用一个工作站同时从 {% data variables.enterprise.prodname_managed_user %} 和个人帐户参与 {% data variables.location.product_location %} 上的存储库,则可以提供支持。 有关详细信息,请参阅“[支持在 {% data variables.product.prodname_dotcom_the_website %} 上具有多个用户帐户的开发人员](#supporting-developers-with-multiple-user-accounts-on-githubcom)”。 +If members of your enterprise must use one workstation to contribute to repositories on {% data variables.location.product_location %} from both a {% data variables.enterprise.prodname_managed_user %} and a personal account, you can provide support. For more information, see "[Supporting developers with multiple user accounts on {% data variables.product.prodname_dotcom_the_website %}](#supporting-developers-with-multiple-user-accounts-on-githubcom)." -## 作为 {% data variables.enterprise.prodname_managed_user %} 进行身份验证 +## Authenticating as a {% data variables.enterprise.prodname_managed_user %} -{% data variables.enterprise.prodname_managed_users_caps %} 必须通过其标识提供者进行身份验证。 若要进行身份验证,{% data variables.enterprise.prodname_managed_user %} 可以访问其 IdP 应用程序门户或使用 {% data variables.product.prodname_dotcom_the_website %} 上的登录页。 +{% data variables.enterprise.prodname_managed_users_caps %} must authenticate through their identity provider. To authenticate, a {% data variables.enterprise.prodname_managed_user %} can visit their IdP application portal or use the login page on {% data variables.product.prodname_dotcom_the_website %}. -默认情况下,当未经身份验证的用户尝试访问使用 {% data variables.product.prodname_emus %} 的企业时,{% data variables.product.company_short %} 会显示 404 错误。 企业所有者可以选择性地启用自动重定向到单一登录 (SSO),而不会显示 404。 有关详细信息,请参阅“[为企业中的安全设置强制实施策略](/enterprise-cloud@latest/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-security-settings-in-your-enterprise#managing-sso-for-unauthenticated-users)”。 +By default, when an unauthenticated user attempts to access an enterprise that uses {% data variables.product.prodname_emus %}, {% data variables.product.company_short %} displays a 404 error. An enterprise owner can optionally enable automatic redirects to single sign-on (SSO) instead of the 404. For more information, see "[Enforcing policies for security settings in your enterprise](/enterprise-cloud@latest/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-security-settings-in-your-enterprise#managing-sso-for-unauthenticated-users)." -{% data reusables.enterprise-accounts.about-recovery-codes %} 有关详细信息,请参阅“[管理企业的恢复代码](/admin/identity-and-access-management/managing-recovery-codes-for-your-enterprise)”。 +{% data reusables.enterprise-accounts.about-recovery-codes %} For more information, see "[Managing recovery codes for your enterprise](/admin/identity-and-access-management/managing-recovery-codes-for-your-enterprise)." -### 通过 {% data variables.product.prodname_dotcom_the_website %} 作为 {% data variables.enterprise.prodname_managed_user %} 进行身份验证 +### Authenticating as a {% data variables.enterprise.prodname_managed_user %} via {% data variables.product.prodname_dotcom_the_website %} -1. 导航到 [https://github.com/login](https://github.com/login)。 -1. 在“用户名或电子邮件地址”文本框中,输入用户名,包括下划线和短代码。 - ![显示登录表单的屏幕截图](/assets/images/help/enterprises/emu-login-username.png) 表单识别用户名后将更新。 无需在此表单中输入密码。 -1. 若要继续访问标识提供者,请单击“使用标识提供者登录”。 - ![显示“使用标识提供者登录”按钮的屏幕截图](/assets/images/help/enterprises/emu-login-submit.png) +1. Navigate to [https://github.com/login](https://github.com/login). +1. In the "Username or email address" text box, enter your username including the underscore and short code. + ![Screenshot showing login form](/assets/images/help/enterprises/emu-login-username.png) + When the form recognizes your username, the form will update. You do not need to enter your password on this form. +1. To continue to your identity provider, click **Sign in with your identity provider**. + ![Screenshot showing "Sign in with your identity provider" button](/assets/images/help/enterprises/emu-login-submit.png) -## 用户名和个人资料信息 +## Usernames and profile information -{% data variables.product.product_name %} 通过规范 IdP 提供的标识符自动为每个用户创建用户名。 有关详细信息,请参阅“[外部身份验证的用户名注意事项](/admin/identity-and-access-management/managing-iam-for-your-enterprise/username-considerations-for-external-authentication)”。 +{% data variables.product.product_name %} automatically creates a username for each person by normalizing an identifier provided by your IdP. For more information, see "[Username considerations for external authentication](/admin/identity-and-access-management/managing-iam-for-your-enterprise/username-considerations-for-external-authentication)." -如果在规范化期间删除 IdP 提供的标识符的唯一部分,则预配用户时可能会发生冲突。 如果由于用户名冲突而无法预配用户,则应修改 IdP 提供的用户名。 有关详细信息,请参阅“[解决用户名问题](/admin/identity-and-access-management/managing-iam-for-your-enterprise/username-considerations-for-external-authentication#resolving-username-problems)”。 +A conflict may occur when provisioning users if the unique parts of the identifier provided by your IdP are removed during normalization. If you're unable to provision a user due to a username conflict, you should modify the username provided by your IdP. For more information, see "[Resolving username problems](/admin/identity-and-access-management/managing-iam-for-your-enterprise/username-considerations-for-external-authentication#resolving-username-problems)." {% data reusables.enterprise-accounts.emu-only-emails-within-the-enterprise-can-conflict %} -IdP 还提供了 {% data variables.enterprise.prodname_managed_user %} 的个人资料名称和电子邮件地址。 {% data variables.enterprise.prodname_managed_users_caps %} 无法更改 {% data variables.product.prodname_dotcom %} 上的个人资料名称或电子邮件地址,并且 IdP 仅可提供单个电子邮件地址。 +The profile name and email address of a {% data variables.enterprise.prodname_managed_user %} is also provided by the IdP. {% data variables.enterprise.prodname_managed_users_caps %} cannot change their profile name or email address on {% data variables.product.prodname_dotcom %}, and the IdP can only provide a single email address. -## 支持在 {% data variables.location.product_location %} 上具有多个用户帐户的开发人员 +## Supporting developers with multiple user accounts on {% data variables.location.product_location %} -团队中的人员可能需要在 {% data variables.location.product_location %} 上参与 {% data variables.enterprise.prodname_emu_enterprise %} 外部的资源。 例如,你可能希望为公司的开放源代码项目维护单独的企业。 由于 {% data variables.enterprise.prodname_managed_user %} 无法参与公共资源,因此用户需要为此工作维护单独的个人帐户。 +People on your team may need to contribute to resources on {% data variables.location.product_location %} that are outside of your {% data variables.enterprise.prodname_emu_enterprise %}. For example, you may wish to maintain a separate enterprise for your company's open source projects. Because a {% data variables.enterprise.prodname_managed_user %} cannot contribute to public resources, users will need to maintain a separate, personal account for this work. -必须使用一个工作站在 {% data variables.location.product_location %} 上从两个用户帐户进行参与的人员可以配置 Git 以简化该过程。 有关详细信息,请参阅“[管理多个帐户](/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-personal-account/managing-multiple-accounts)”。 +People who must contribute from two user accounts on {% data variables.location.product_location %} using one workstation can configure Git to simplify the process. For more information, see "[Managing multiple accounts](/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-personal-account/managing-multiple-accounts)." diff --git a/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/about-support-for-your-idps-conditional-access-policy.md b/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/about-support-for-your-idps-conditional-access-policy.md index 74dd43ee44..33c6b16923 100644 --- a/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/about-support-for-your-idps-conditional-access-policy.md +++ b/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/about-support-for-your-idps-conditional-access-policy.md @@ -1,7 +1,7 @@ --- title: About support for your IdP's Conditional Access Policy shortTitle: Conditional access policy -intro: 'When your enterprise uses OIDC SSO, {% data variables.product.prodname_dotcom %} will validate access to your enterprise and its resources using your IdP''s Conditional Access Policy (CAP).' +intro: 'When your enterprise uses OIDC SSO, {% data variables.product.prodname_dotcom %} can validate access to your enterprise and its resources using your IdP''s Conditional Access Policy (CAP).' product: '{% data reusables.gated-features.emus %}' versions: feature: oidc-for-emu @@ -12,22 +12,17 @@ topics: - SSO --- -{% data reusables.enterprise-accounts.oidc-beta-notice %} +{% data reusables.enterprise-accounts.azure-emu-support-oidc %} ## About support for Conditional Access Policies {% data reusables.enterprise-accounts.emu-cap-validates %} -CAP support is enabled automatically for any {% data variables.enterprise.prodname_emu_enterprise %} that enables OIDC SSO and cannot be disabled. {% data variables.product.prodname_dotcom %} enforces your IdP's IP conditions but not device compliance conditions. +{% data variables.product.product_name %} supports CAP for any {% data variables.enterprise.prodname_emu_enterprise %} where OIDC SSO is enabled. {% data variables.product.product_name %} enforces your IdP's IP conditions but cannot enforce your device compliance conditions. Enterprise owners can choose to use this IP allow list configuration instead of {% data variables.product.product_name %}'s IP allow list, and can do so once OIDC SSO is configured. For more information about IP allow lists, see "[Restricting network traffic with an IP allow list](/admin/configuration/configuring-your-enterprise/restricting-network-traffic-to-your-enterprise-with-an-ip-allow-list)" and "[Managing allowed IP addresses for your organization](/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization)." + For more information about using OIDC with {% data variables.product.prodname_emus %}, see "[Configuring OIDC for Enterprise Managed Users](/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/configuring-oidc-for-enterprise-managed-users)" and "[Migrating from SAML to OIDC](/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/migrating-from-saml-to-oidc)." -{% note %} - -**Note:** If you use Conditional Access (CA) network location policies in your Azure AD tenant, do not use the IP allow list feature on {% data variables.product.prodname_dotcom_the_website %}, with your enterprise account or with any of the organizations owned by the enterprise. Using both is unsupported and can result in the wrong policy applying. For more information about IP allow lists, see "[Enforcing security settings in your enterprise](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-security-settings-in-your-enterprise#managing-allowed-ip-addresses-for-organizations-in-your-enterprise)" and "[Managing allowed IP addresses for your organization](/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization)." - -{% endnote %} - ## Considerations for integrations and automations {% data variables.product.prodname_dotcom %} sends the originating IP address to your IdP for validation against your CAP. To make sure actions and apps are not blocked by your IdP's CAP, you will need to make changes to your configuration. @@ -46,4 +41,4 @@ When {% data variables.product.prodname_github_apps %} and {% data variables.pro You can contact the owners of the apps you want to use, ask for their IP ranges, and configure your IdP's CAP to allow access from those IP ranges. If you're unable to contact the owners, you can review your IdP sign-in logs to review the IP addresses seen in the requests, then allow-list those addresses. -You can also enable IP allow list configuration for installed {% data variables.product.prodname_github_apps %}. When enabled, all {% data variables.product.prodname_github_apps %} and {% data variables.product.prodname_oauth_apps %} will continue working regardless of the originating IP address. For more information, see "[Enforcing policies for security settings in your enterprise](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-security-settings-in-your-enterprise#allowing-access-by-github-apps)." +If you do not wish to allow all of the IP ranges for all of your enterprise's apps, you can also exempt installed {% data variables.product.prodname_github_apps %} and authorized {% data variables.product.prodname_oauth_apps %} from the IdP allow list. If you do so, these apps will continue working regardless of the originating IP address. For more information, see "[Enforcing policies for security settings in your enterprise](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-security-settings-in-your-enterprise#allowing-access-by-github-apps)." diff --git a/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/configuring-oidc-for-enterprise-managed-users.md b/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/configuring-oidc-for-enterprise-managed-users.md index 66e9c9d84f..6812965089 100644 --- a/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/configuring-oidc-for-enterprise-managed-users.md +++ b/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/configuring-oidc-for-enterprise-managed-users.md @@ -12,7 +12,7 @@ topics: - SSO --- -{% data reusables.enterprise-accounts.oidc-beta-notice %} +{% data reusables.enterprise-accounts.azure-emu-support-oidc %} ## About OIDC for Enterprise Managed Users @@ -22,13 +22,13 @@ With {% data variables.product.prodname_emus %}, your enterprise uses your ident You can adjust the lifetime of a session, and how often a {% data variables.enterprise.prodname_managed_user %} needs to reauthenticate with your IdP, by changing the lifetime policy property of the ID tokens issued for {% data variables.product.prodname_dotcom %} from your IdP. The default lifetime is one hour. For more information, see "[Configurable token lifetimes in the Microsoft identity platform](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-configurable-token-lifetimes)" in the Azure AD documentation. -If you currently use SAML SSO for authentication and would prefer to use OIDC and benefit from CAP support, you can follow a migration path. For more information, see "[Migrating from SAML to OIDC](/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/migrating-from-saml-to-oidc)." +{% data reusables.enterprise_user_management.SAML-to-OIDC-migration-for-EMU %} {% data reusables.enterprise-accounts.oidc-gei-warning %} ## Identity provider support -Support for OIDC is in public beta and available for customers using Azure Active Directory (Azure AD). +Support for OIDC is available for customers using Azure Active Directory (Azure AD). Each Azure AD tenant can support only one OIDC integration with {% data variables.product.prodname_emus %}. If you want to connect Azure AD to more than one enterprise on {% data variables.product.prodname_dotcom %}, use SAML instead. For more information, see "[Configuring SAML single sign-on for {% data variables.product.prodname_emus %}](/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/configuring-saml-single-sign-on-for-enterprise-managed-users)." diff --git a/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/configuring-saml-single-sign-on-for-enterprise-managed-users.md b/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/configuring-saml-single-sign-on-for-enterprise-managed-users.md index fe4dde3d44..d5b35b288a 100644 --- a/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/configuring-saml-single-sign-on-for-enterprise-managed-users.md +++ b/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/configuring-saml-single-sign-on-for-enterprise-managed-users.md @@ -19,7 +19,7 @@ topics: ## About SAML single sign-on for {% data variables.product.prodname_emus %} -With {% data variables.product.prodname_emus %}, your enterprise uses SAML SSO to authenticate all members. Instead of signing in to {% data variables.product.prodname_dotcom %} with a {% data variables.product.prodname_dotcom %} username and password, members of your enterprise will sign in through your IdP. +With {% data variables.product.prodname_emus %}, your enterprise uses your corporate identity provider to authenticate all members. Instead of signing in to {% data variables.product.prodname_dotcom %} with a {% data variables.product.prodname_dotcom %} username and password, members of your enterprise will sign in through your IdP. {% data variables.product.prodname_emus %} supports the following IdPs: @@ -27,6 +27,9 @@ With {% data variables.product.prodname_emus %}, your enterprise uses SAML SSO t After you configure SAML SSO, we recommend storing your recovery codes so you can recover access to your enterprise in the event that your identity provider is unavailable. + +{% data reusables.enterprise_user_management.SAML-to-OIDC-migration-for-EMU %} + {% note %} **Note:** When SAML SSO is enabled, the only setting you can update on {% data variables.product.prodname_dotcom %} for your existing SAML configuration is the SAML certificate. If you need to update the Sign on URL or Issuer, you must first disable SAML SSO and then reconfigure SAML SSO with the new settings. diff --git a/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/migrating-from-saml-to-oidc.md b/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/migrating-from-saml-to-oidc.md index 1d10031b84..8ec69251ad 100644 --- a/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/migrating-from-saml-to-oidc.md +++ b/translations/zh-CN/content/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/migrating-from-saml-to-oidc.md @@ -12,7 +12,7 @@ topics: - SSO --- -{% data reusables.enterprise-accounts.oidc-beta-notice %} +{% data reusables.enterprise-accounts.azure-emu-support-oidc %} ## About migrating your {% data variables.enterprise.prodname_emu_enterprise %} from SAML to OIDC diff --git a/translations/zh-CN/content/admin/identity-and-access-management/using-saml-for-enterprise-iam/about-saml-for-enterprise-iam.md b/translations/zh-CN/content/admin/identity-and-access-management/using-saml-for-enterprise-iam/about-saml-for-enterprise-iam.md index 6bbe5ad199..8ddb21e79d 100644 --- a/translations/zh-CN/content/admin/identity-and-access-management/using-saml-for-enterprise-iam/about-saml-for-enterprise-iam.md +++ b/translations/zh-CN/content/admin/identity-and-access-management/using-saml-for-enterprise-iam/about-saml-for-enterprise-iam.md @@ -124,5 +124,7 @@ If you use Okta as your IdP, you can map your Okta groups to teams on {% data va ## Further reading - [SAML Wiki](https://wiki.oasis-open.org/security) on the OASIS website -- [System for Cross-domain Identity Management: Protocol (RFC 7644)](https://tools.ietf.org/html/rfc7644) on the IETF website{% ifversion ghae %} -- [Restricting network traffic to your enterprise](/admin/configuration/restricting-network-traffic-to-your-enterprise){% endif %} +- [System for Cross-domain Identity Management: Protocol (RFC 7644)](https://tools.ietf.org/html/rfc7644) on the IETF website +{%- ifversion ghae %} +- "[Restricting network traffic to your enterprise with an IP allow list](/admin/configuration/configuring-your-enterprise/restricting-network-traffic-to-your-enterprise-with-an-ip-allow-list)" +{%- endif %} diff --git a/translations/zh-CN/content/admin/identity-and-access-management/using-saml-for-enterprise-iam/configuring-authentication-and-provisioning-for-your-enterprise-using-azure-ad.md b/translations/zh-CN/content/admin/identity-and-access-management/using-saml-for-enterprise-iam/configuring-authentication-and-provisioning-for-your-enterprise-using-azure-ad.md index ceebd276ec..39a276a1c3 100644 --- a/translations/zh-CN/content/admin/identity-and-access-management/using-saml-for-enterprise-iam/configuring-authentication-and-provisioning-for-your-enterprise-using-azure-ad.md +++ b/translations/zh-CN/content/admin/identity-and-access-management/using-saml-for-enterprise-iam/configuring-authentication-and-provisioning-for-your-enterprise-using-azure-ad.md @@ -1,7 +1,7 @@ --- -title: Configuring authentication and provisioning for your enterprise using Azure AD +title: 使用 Azure AD 为企业配置身份验证和预配 shortTitle: Configure with Azure AD -intro: 'You can use a tenant in Azure Active Directory (Azure AD) as an identity provider (IdP) to centrally manage authentication and user provisioning for {% data variables.location.product_location %}.' +intro: '可以使用 Azure Active Directory (Azure AD) 中的租户作为标识提供者 (IdP) 来集中管理{% data variables.location.product_location %}的身份验证和用户预配。' permissions: 'Enterprise owners can configure authentication and provisioning for an enterprise on {% data variables.product.product_name %}.' versions: ghae: '*' @@ -17,65 +17,69 @@ redirect_from: - /admin/authentication/configuring-authentication-and-provisioning-for-your-enterprise-using-azure-ad - /admin/authentication/configuring-authentication-and-provisioning-with-your-identity-provider/configuring-authentication-and-provisioning-for-your-enterprise-using-azure-ad - /admin/identity-and-access-management/configuring-authentication-and-provisioning-with-your-identity-provider/configuring-authentication-and-provisioning-for-your-enterprise-using-azure-ad +ms.openlocfilehash: bfd93814b11066d6da2d87a2e1f0a8bd5461e93f +ms.sourcegitcommit: ced661bdffebd0f96f6f76db109fbe31983448ba +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/16/2022 +ms.locfileid: '148167058' --- +## 关于使用 Azure AD 进行身份验证和用户预配 -## About authentication and user provisioning with Azure AD +Azure Active Directory (Azure AD) 是一项来自 Microsoft 的服务,它允许您集中管理用户帐户和 web 应用程序访问。 有关详细信息,请参阅 Microsoft Docs 中的[什么是 Azure Active Directory?](https://docs.microsoft.com/azure/active-directory/fundamentals/active-directory-whatis) -Azure Active Directory (Azure AD) is a service from Microsoft that allows you to centrally manage user accounts and access to web applications. For more information, see [What is Azure Active Directory?](https://docs.microsoft.com/azure/active-directory/fundamentals/active-directory-whatis) in the Microsoft Docs. - -To manage identity and access for {% data variables.product.product_name %}, you can use an Azure AD tenant as a SAML IdP for authentication. You can also configure Azure AD to automatically provision accounts and access membership with SCIM, which allows you to create {% data variables.product.product_name %} users and manage team and organization membership from your Azure AD tenant. +要管理身份以及对 {% data variables.product.product_name %} 的访问,您可以使用 Azure AD 租户作为 SAML IdP 进行身份验证。 也可以配置 Azure AD 以自动预配帐户并获取 SCIM 成员资格,这样你可以创建 {% data variables.product.product_name %} 用户,并从你的 Azure AD 租户管理团队和组织成员资格。 {% data reusables.scim.ghes-beta-note %} -After you enable SAML SSO and SCIM for {% data variables.product.product_name %} using Azure AD, you can accomplish the following from your Azure AD tenant. +使用 Azure AD 对 {% data variables.product.product_name %} 启用 SAML SSO 和 SCIM 后,你可以从 Azure AD 租户完成以下任务。 -* Assign the {% data variables.product.product_name %} application on Azure AD to a user account to automatically create and grant access to a corresponding user account on {% data variables.product.product_name %}. -* Unassign the {% data variables.product.product_name %} application to a user account on Azure AD to deactivate the corresponding user account on {% data variables.product.product_name %}. -* Assign the {% data variables.product.product_name %} application to an IdP group on Azure AD to automatically create and grant access to user accounts on {% data variables.product.product_name %} for all members of the IdP group. In addition, the IdP group is available on {% data variables.product.product_name %} for connection to a team and its parent organization. -* Unassign the {% data variables.product.product_name %} application from an IdP group to deactivate the {% data variables.product.product_name %} user accounts of all IdP users who had access only through that IdP group and remove the users from the parent organization. The IdP group will be disconnected from any teams on {% data variables.product.product_name %}. +* 将 Azure AD 上的 {% data variables.product.product_name %} 应用程序分配给用户帐户,以便在 {% data variables.product.product_name %} 上自动创建并授予对相应用户帐户的访问权限。 +* 为 Azure AD 上的用户帐户取消分配 {% data variables.product.product_name %} 应用程序,以便在 {% data variables.product.product_name %} 上停用相应的用户帐户。 +* 为 Azure AD 上的 IdP 组分配 {% data variables.product.product_name %} 应用程序,以便为 IdP 组的所有成员自动创建并授予对 {% data variables.product.product_name %} 上用户帐户的访问权限。 此外,IdP 组也可以在 {% data variables.product.product_name %} 上连接到团队及其父组织。 +* 从 IdP 组取消分配 {% data variables.product.product_name %} 应用程序来停用仅通过该 IdP 组访问的所有 IdP 用户的 {% data variables.product.product_name %} 用户帐户,并从父组织中删除这些用户。 IdP 组将与 {% data variables.product.product_name %} 上的任何团队断开连接。 -For more information about managing identity and access for your enterprise on {% data variables.location.product_location %}, see "[Managing identity and access for your enterprise](/admin/authentication/managing-identity-and-access-for-your-enterprise)." For more information about synchronizing teams with IdP groups, see "[Synchronizing a team with an identity provider group](/organizations/organizing-members-into-teams/synchronizing-a-team-with-an-identity-provider-group)." +有关在{% data variables.location.product_location %}上管理企业的身份验证和访问控制的详细信息,请参阅“[管理企业的身份验证和访问控制](/admin/authentication/managing-identity-and-access-for-your-enterprise)”。 有关将团队与 IdP 组同步的详细信息,请参阅“[将团队与标识提供者组同步](/organizations/organizing-members-into-teams/synchronizing-a-team-with-an-identity-provider-group)”。 -## Prerequisites +## 先决条件 -- To configure authentication and user provisioning for {% data variables.product.product_name %} using Azure AD, you must have an Azure AD account and tenant. For more information, see the [Azure AD website](https://azure.microsoft.com/free/active-directory) and [Quickstart: Create an Azure Active Directory tenant](https://docs.microsoft.com/azure/active-directory/develop/quickstart-create-new-tenant) in the Microsoft Docs. +- 要使用 Azure AD 配置 {% data variables.product.product_name %} 的身份验证和用户预配,您必须有 Azure AD 帐户和租户。 有关详细信息,请参阅 [Azure AD 网站](https://azure.microsoft.com/free/active-directory)和 Microsoft Docs 中的[快速入门:创建 Azure Active Directory 租户](https://docs.microsoft.com/azure/active-directory/develop/quickstart-create-new-tenant)。 {%- ifversion scim-for-ghes %} -- {% data reusables.saml.ghes-you-must-configure-saml-sso %} -{%- endif %} +- {% data reusables.saml.ghes-you-must-configure-saml-sso %} {%- endif %} - {% data reusables.saml.create-a-machine-user %} -## Configuring authentication and user provisioning with Azure AD +## 使用 Azure AD 配置身份验证和用户预配 -In your Azure AD tenant, add the application for {% data variables.product.product_name %}, then configure provisioning. +在 Azure AD 租户中,添加 {% data variables.product.product_name %} 的应用程序,然后配置预配。 {% ifversion ghae %} -1. In Azure AD, add the {% data variables.enterprise.ae_azure_ad_app_link %} to your tenant and configure single sign-on. For more information, see [Tutorial: Azure Active Directory single sign-on (SSO) integration with {% data variables.product.product_name %}](https://docs.microsoft.com/azure/active-directory/saas-apps/github-ae-tutorial) in the Microsoft Docs. +1. 在 Azure AD 中,将 {% data variables.enterprise.ae_azure_ad_app_link %} 添加到租户并配置单一登录。 有关详细信息,请参阅 Microsoft Docs 中的[教程:Azure Active Directory 单一登录 (SSO) 与 {% data variables.product.product_name %} 的集成](https://docs.microsoft.com/azure/active-directory/saas-apps/github-ae-tutorial)。 -1. In {% data variables.product.product_name %}, enter the details for your Azure AD tenant. +1. 在 {% data variables.product.product_name %} 中,输入 Azure AD 租户的详细信息。 - {% data reusables.saml.ae-enable-saml-sso-during-bootstrapping %} - - If you've already configured SAML SSO for {% data variables.location.product_location %} using another IdP and you want to use Azure AD instead, you can edit your configuration. For more information, see "[Configuring SAML single sign-on for your enterprise](/admin/authentication/configuring-saml-single-sign-on-for-your-enterprise#editing-the-saml-sso-configuration)." + - 如果已使用其他 IdP 为{% data variables.location.product_location %}配置 SAML SSO,并且希望改为使用 Azure AD,你可以编辑配置。 有关详细信息,请参阅“[为企业配置 SAML 单一登录](/admin/authentication/configuring-saml-single-sign-on-for-your-enterprise#editing-the-saml-sso-configuration)”。 -1. Enable user provisioning in {% data variables.product.product_name %} and configure user provisioning in Azure AD. For more information, see "[Configuring user provisioning for your enterprise](/admin/authentication/configuring-user-provisioning-for-your-enterprise#enabling-user-provisioning-for-your-enterprise)." +1. 在 {% data variables.product.product_name %} 中启用用户预配,并在 Azure AD 中配置用户预配。 有关详细信息,请参阅“[为企业配置用户预配](/admin/authentication/configuring-user-provisioning-for-your-enterprise#enabling-user-provisioning-for-your-enterprise)”。 {% elsif scim-for-ghes %} -1. In the Azure AD tenant, in the left sidebar, click **Provisioning**. +1. 在 Azure AD 租户的左侧栏中,单击“预配”。 -1. Under "Tenant URL", type the full endpoint URL for SCIM on {% data variables.location.product_location %}. For more information, see "[SCIM](/rest/enterprise-admin/scim#scim-endpoint-urls)" in the REST API documentation. +1. 在“租户 URL”下,键入 {% data variables.location.product_location %}上 SCIM 的完整终结点 URL。 有关详细信息,请参阅 REST API 文档中的“[SCIM](/rest/enterprise-admin/scim#scim-endpoint-urls)”。 -1. Under "Secret Token", type the {% data variables.product.pat_v1 %} that you created in step 4 of "[Configuring user provisioning with SCIM for your enterprise](/admin/identity-and-access-management/using-saml-for-enterprise-iam/configuring-user-provisioning-with-scim-for-your-enterprise#enabling-user-provisioning-for-your-enterprise)." +1. 在“机密令牌”下,输入在“[使用 SCIM 为企业配置用户配置](/admin/identity-and-access-management/using-saml-for-enterprise-iam/configuring-user-provisioning-with-scim-for-your-enterprise#enabling-user-provisioning-for-your-enterprise)”的步骤 4 中创建的{% data variables.product.pat_v1 %}。 -1. To ensure a successful connection from Azure AD to {% data variables.location.product_location %}, Click **Test Connection**. +1. 要确保从 Azure AD 成功连接到 {% data variables.location.product_location %},请单击“测试连接”。 -1. After you ensure a successful connection, at the top of the page, click **Save**. +1. 确保连接成功后,单击页面顶部的“保存”。 {% endif %} -1. Assign an enterprise owner for {% data variables.product.product_name %} in Azure AD. The process you should follow depends on whether you configured provisioning. For more information about enterprise owners, see "[Roles in an enterprise](/admin/user-management/managing-users-in-your-enterprise/roles-in-an-enterprise#enterprise-owners)." - - If you configured provisioning, to grant the user enterprise ownership in {% data variables.product.product_name %}, assign the enterprise owner role to the user in Azure AD. - - If you did not configure provisioning, to grant the user enterprise ownership in {% data variables.product.product_name %}, include the `administrator` attribute in the SAML assertion for the user account on the IdP, with the value of `true`. For more information about including the `administrator` attribute in the SAML claim from Azure AD, see [How to: customize claims issued in the SAML token for enterprise applications](https://docs.microsoft.com/azure/active-directory/develop/active-directory-saml-claims-customization) in the Microsoft Docs. +1. 在 Azure AD 中为 {% data variables.product.product_name %} 分配企业所有者。 应遵循的过程取决于你是否配置了预配。 有关企业所有者的详细信息,请参阅“[企业中的角色](/admin/user-management/managing-users-in-your-enterprise/roles-in-an-enterprise#enterprise-owners)”。 + - 如果配置了预配,要向用户授予 {% data variables.product.product_name %} 中的企业所有权,请在 Azure AD 中为用户分配企业所有者角色。 + - 如果未配置预配,要向用户授予 {% data variables.product.product_name %} 中的企业所有权,请在 IdP 上的用户帐户的 SAML 断言中包含 `administrator` 属性,其值为 `true`。 有关在 Azure AD 的 SAML 声明中包含 `administrator` 属性的详细信息,请参阅 Microsoft Docs 中的[如何:为企业应用程序自定义 SAML 令牌中颁发的声明](https://docs.microsoft.com/azure/active-directory/develop/active-directory-saml-claims-customization)。 diff --git a/translations/zh-CN/content/admin/index.md b/translations/zh-CN/content/admin/index.md index 210f340b53..8af8a0644e 100644 --- a/translations/zh-CN/content/admin/index.md +++ b/translations/zh-CN/content/admin/index.md @@ -73,7 +73,7 @@ featuredLinks: - '{% ifversion ghae %}/admin/user-management/auditing-users-across-your-enterprise{% endif %}' - /admin/identity-and-access-management/managing-iam-for-your-enterprise/about-authentication-for-your-enterprise - /admin/policies/enforcing-policies-for-your-enterprise/about-enterprise-policies - - '{% ifversion ghae %}/admin/configuration/restricting-network-traffic-to-your-enterprise{% endif %}' + - '{% ifversion ghae %}/admin/configuration/restricting-network-traffic-to-your-enterprise-with-an-ip-allow-list{% endif %}' - '{% ifversion ghes %}/admin/configuration/configuring-backups-on-your-appliance{% endif %}' - '{% ifversion ghes %}/admin/enterprise-management/creating-a-high-availability-replica{% endif %}' - '{% ifversion ghes %}/admin/overview/about-upgrades-to-new-releases{% endif %}' @@ -125,11 +125,11 @@ children: - /guides - /release-notes - /all-releases -ms.openlocfilehash: 3980ad01e56bf1e38dd6473c5e5246c6d45350eb -ms.sourcegitcommit: 3268914369fb29540e4d88ee5e56bc7a41f2a60e +ms.openlocfilehash: 0a84555b92c4645807d082f0d7f9348dfd3fc4bf +ms.sourcegitcommit: c562c85cc75ffe1eb4e9595d8adc09ec71697ab1 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 10/26/2022 -ms.locfileid: '148111306' +ms.lasthandoff: 11/22/2022 +ms.locfileid: '148179979' --- diff --git a/translations/zh-CN/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/identifying-audit-log-events-performed-by-an-access-token.md b/translations/zh-CN/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/identifying-audit-log-events-performed-by-an-access-token.md new file mode 100644 index 0000000000..b683d27cbb --- /dev/null +++ b/translations/zh-CN/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/identifying-audit-log-events-performed-by-an-access-token.md @@ -0,0 +1,73 @@ +--- +title: 标识由访问令牌执行的审核日志事件 +shortTitle: Identify events by token +intro: '可以在企业中标识由特定 {% data variables.product.pat_generic %} 或 OAuth 令牌执行的操作。' +versions: + feature: token-audit-log +ms.openlocfilehash: 4452e740e611ea3f903c5d122222b3cb575ba37d +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159496' +--- +## 关于审核日志中的令牌数据 + +在企业的审核日志中,对于使用 {% data variables.product.pat_generic %} 或 OAuth 应用程序进行身份验证所执行的任何操作,事件数据将显示所使用的身份验证方法和令牌的 SHA-256 哈希值。 + +如果得知某个令牌已被盗用,可以通过在企业的审核日志中搜索与该令牌相关联的所有事件,来了解由被盗用的令牌执行的操作。 + +导出审核日志时不包括经过哈希处理的令牌值。 + +## 搜索与令牌关联的事件 + +在搜索与特定令牌关联的事件时,可以使用 UI 或 REST API。 在任一情况下,都需要先了解令牌的 SHA-256 哈希值。 + +### 为令牌生成 SHA-256 哈希值 + +如果只有原始令牌值,则需要先生成 SHA-256 哈希值,然后才能搜索令牌。 + +对于 MacOS 和 Linux,可使用 `echo -n TOKEN | openssl dgst -sha256 -binary | base64` 并将 TOKEN 替换为令牌值。 + +对于 Powershell,可以使用以下脚本返回给定字符串的 SHA-256 哈希值。 + +```shell{:copy} +Param ( + [Parameter(Mandatory=$true)] + [string] + $ClearString +) + +$hasher = [System.Security.Cryptography.HashAlgorithm]::Create('sha256') +$hash = $hasher.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($ClearString)) + +$hashString = [System.BitConverter]::ToString($hash) +$hashString.Replace('-', '') +``` + +### 在 {% data variables.product.prodname_dotcom %} 上进行搜索 + +在 {% data variables.product.prodname_dotcom %} 上搜索审核日志时,在搜索查询中添加 `hashed_token:"VALUE"`,并将 `VALUE` 替换为令牌的 SHA-256 哈希值。 + +{% note %} + +注意:确保将经过哈希处理的令牌值用引号括起来。 + +{% endnote %} + +### 使用 REST API 进行搜索 + +在生成 SHA-256 哈希值后,还需要对该哈希值进行 URI 转义,然后才能使用 REST API 搜索令牌。 大多数主要的编程语言都提供了用于 URI 转义的实用工具。 例如,[encodeURIComponent()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) 会对 JavaScript 字符串进行编码。 + +然后,在搜索短语中添加 `hashed_token:"VALUE"`,并将 VALUE 替换为 URI 转义的哈希。 + +例如,如果企业帐户的名称为 `octo-corp`,则以下 curl 命令将在 @octo-corp 的审核日志中搜索与令牌相关联的所有事件,该令牌的 URI 编码的 SHA-256 哈希值为 `EH4L8o6PfCqipALbL%2BQT62lyqUtnI7ql0SPbkaQnjv8`。 + +``` +curl --location --request GET 'https://api.github.com/enterprises/octo-corp/audit-log?phrase=hashed_token:"EH4L8o6PfCqipALbL%2BQT62lyqUtnI7ql0SPbkaQnjv8"' \ +--header 'Authorization: Basic TOKEN' \ +``` + +## 延伸阅读 + +- [在企业中使用审核日志 API](/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/using-the-audit-log-api-for-your-enterprise) diff --git a/translations/zh-CN/content/admin/packages/quickstart-for-configuring-your-minio-storage-bucket-for-github-packages.md b/translations/zh-CN/content/admin/packages/quickstart-for-configuring-your-minio-storage-bucket-for-github-packages.md index 935cf07d90..68519a5b1b 100644 --- a/translations/zh-CN/content/admin/packages/quickstart-for-configuring-your-minio-storage-bucket-for-github-packages.md +++ b/translations/zh-CN/content/admin/packages/quickstart-for-configuring-your-minio-storage-bucket-for-github-packages.md @@ -1,6 +1,6 @@ --- -title: Quickstart for configuring your MinIO storage bucket for GitHub Packages -intro: 'Configure your custom MinIO storage bucket for use with {% data variables.product.prodname_registry %}.' +title: 为 GitHub Packages 配置 MinIO 存储桶的快速入门 +intro: '配置您的自定义 MinIO 存储桶,用于 {% data variables.product.prodname_registry %}。' versions: ghes: '*' type: quick_start @@ -9,43 +9,48 @@ topics: - Enterprise - Storage shortTitle: Quickstart for MinIO +ms.openlocfilehash: 2d26aa879b0a59d8c6bd4d80a04ec2aa30f8c422 +ms.sourcegitcommit: 8f1801040a84ca9353899a2d1e6782c702aaed0d +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/16/2022 +ms.locfileid: '148166551' --- - {% data reusables.package_registry.packages-ghes-release-stage %} -Before you can enable and configure {% data variables.product.prodname_registry %} on {% data variables.location.product_location_enterprise %}, you need to prepare your third-party storage solution. +在 {% data variables.location.product_location_enterprise %} 上启用和配置 {% data variables.product.prodname_registry %} 之前,需要准备第三方存储解决方案。 -MinIO offers object storage with support for the S3 API and {% data variables.product.prodname_registry %} on your enterprise. +MinIO 在企业上提供对象存储并支持 S3 API 和 {% data variables.product.prodname_registry %}。 -This quickstart shows you how to set up MinIO using Docker for use with {% data variables.product.prodname_registry %} but you have other options for managing MinIO besides Docker. For more information about MinIO, see the official [MinIO docs](https://docs.min.io/). +此快速入门将演示如何使用 Docker 设置 MinIO 以与 {% data variables.product.prodname_registry %} 使用,但除了 Docker 之外,您还有其他用于管理 MinIO 的选项。 有关 MinIO 的详细信息,请参阅官方 [MinIO 文档](https://docs.min.io/)。 -## 1. Choose a MinIO mode for your needs +## 1. 根据需求选择 MinIO 模式 -| MinIO mode | Optimized for | Storage infrastructure required | +| MinIO 模式 | 优化对象 | 需要存储基础架构 | |----|----|----| -| Standalone MinIO (on a single host) | Fast setup | N/A | -| Clustered MinIO (also called Distributed MinIO)| Data security | Storage servers running in a cluster | +| 独立 MinIO(在单个主机上) | 快速设置 | 空值 | +| 群集式 MinIO(也称为分布式 MinIO)| 数据安全性 | 在群集中运行的存储服务器 | -For more information about your options, see the official [MinIO docs](https://docs.min.io/). +有关选项的详细信息,请参阅官方 [MinIO 文档](https://docs.min.io/)。 -## 2. Install, run, and sign in to MinIO +## 2. 安装、运行和登录到 MinIO -1. Set up your preferred environment variables for MinIO. +1. 为 MinIO 设置首选环境变量。 - These examples use `MINIO_DIR`: + 这些示例使用 `MINIO_DIR`: ```shell $ export MINIO_DIR=$(pwd)/minio $ mkdir -p $MINIO_DIR ``` -2. Install MinIO. +2. 安装 MinIO。 ```shell $ docker pull minio/minio ``` - For more information, see the official "[MinIO Quickstart Guide](https://docs.min.io/docs/minio-quickstart-guide)." + 有关详细信息,请参阅官方“[MinIO 快速入门指南](https://docs.min.io/docs/minio-quickstart-guide)”。 -3. Sign in to MinIO using your MinIO access key and secret. +3. 使用您的 MinIO 访问密钥登录 MinIO。 {% linux %} ```shell @@ -63,16 +68,16 @@ For more information about your options, see the official [MinIO docs](https://d ``` {% endmac %} - You can access your MinIO keys using the environment variables: + 您可以使用环境变量访问 MinIO 密钥: ```shell $ echo $MINIO_ACCESS_KEY $ echo $MINIO_SECRET_KEY ``` -4. Run MinIO in your chosen mode. +4. 在您选择的模式下运行 MinIO。 - * Run MinIO using Docker on a single host: + * 在单一主机上使用 Docker 运行 MinIO: ```shell $ docker run -p 9000:9000 \ @@ -82,42 +87,42 @@ For more information about your options, see the official [MinIO docs](https://d minio/minio server /data ``` - For more information, see "[MinIO Docker Quickstart guide](https://docs.min.io/docs/minio-docker-quickstart-guide.html)." + 有关详细信息,请参阅“[MinIO Docker 快速入门指南](https://docs.min.io/docs/minio-docker-quickstart-guide.html)”。 - * Run MinIO using Docker as a cluster. This MinIO deployment uses several hosts and MinIO's erasure coding for the strongest data protection. To run MinIO in a cluster mode, see the "[Distributed MinIO Quickstart Guide](https://docs.min.io/docs/distributed-minio-quickstart-guide.html)." + * 使用 Docker 作为集群运行 MinIO: 此 MinIO 部署使用多个主机和 MinIO 的擦除编码来提供最强的数据保护。 若要在群集模式下运行 MinIO,请参阅“[分布式 MinIO 快速入门指南](https://docs.min.io/docs/distributed-minio-quickstart-guide.html)”。 -## 3. Create your MinIO bucket for {% data variables.product.prodname_registry %} +## 3. 为 {% data variables.product.prodname_registry %} 创建 MinIO 存储桶 -1. Install the MinIO client. +1. 安装 MinIO 客户端。 ```shell $ docker pull minio/mc ``` -2. Create a bucket with a host URL that {% data variables.product.prodname_ghe_server %} can access. +2. 使用 {% data variables.product.prodname_ghe_server %} 可以访问的主机 URL 创建存储桶。 - * Local deployments example: + * 本地部署示例: ```shell $ export MC_HOST_minio="http://${MINIO_ACCESS_KEY}:${MINIO_SECRET_KEY} @localhost:9000" $ docker run minio/mc BUCKET-NAME ``` - This example can be used for MinIO standalone. + 此示例可用于 MinIO 单机版。 - * Clustered deployments example: + * 集群部署示例: ```shell $ export MC_HOST_minio="http://${MINIO_ACCESS_KEY}:${MINIO_SECRET_KEY} @minioclustername.example.com:9000" $ docker run minio/mc mb packages ``` -## Next steps +## 后续步骤 -To finish configuring storage for {% data variables.product.prodname_registry %}, you'll need to copy the MinIO storage URL: +要完成 {% data variables.product.prodname_registry %} 的存储配置,您需要复制 MinIO 存储 URL: ``` echo "http://${MINIO_ACCESS_KEY}:${MINIO_SECRET_KEY}@minioclustername.example.com:9000" ``` -For the next steps, see "[Enabling {% data variables.product.prodname_registry %} with MinIO](/admin/packages/enabling-github-packages-with-minio)." +有关后续步骤,请参阅“[使用 MinIO 启用 {% data variables.product.prodname_registry %}](/admin/packages/enabling-github-packages-with-minio)”。 diff --git a/translations/zh-CN/content/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-security-settings-in-your-enterprise.md b/translations/zh-CN/content/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-security-settings-in-your-enterprise.md index bedf7001c2..c2227ba0ff 100644 --- a/translations/zh-CN/content/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-security-settings-in-your-enterprise.md +++ b/translations/zh-CN/content/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-security-settings-in-your-enterprise.md @@ -25,7 +25,7 @@ shortTitle: Policies for security settings ## About policies for security settings in your enterprise -You can enforce policies to control the security settings for organizations owned by your enterprise on {% data variables.product.product_name %}. By default, organization owners can manage security settings. For more information, see "[Keeping your organization secure](/organizations/keeping-your-organization-secure)." +You can enforce policies to control the security settings for organizations owned by your enterprise on {% data variables.product.product_name %}. By default, organization owners can manage security settings. {% ifversion ghec or ghes %} @@ -59,93 +59,6 @@ Before you require use of two-factor authentication, we recommend notifying orga {% endif %} -{% ifversion ghec or ghae %} - -## Managing allowed IP addresses for organizations in your enterprise - -{% ifversion ghae %} - -You can restrict network traffic to your enterprise on {% data variables.product.product_name %}. For more information, see "[Restricting network traffic to your enterprise](/admin/configuration/configuring-your-enterprise/restricting-network-traffic-to-your-enterprise)." - -{% elsif ghec %} - -Enterprise owners can restrict access to private assets owned by organizations in an enterprise by configuring an allow list for specific IP addresses. {% data reusables.identity-and-permissions.ip-allow-lists-example-and-restrictions %} - -{% data reusables.identity-and-permissions.ip-allow-lists-cidr-notation %} - -{% data reusables.identity-and-permissions.ip-allow-lists-enable %} {% data reusables.identity-and-permissions.ip-allow-lists-enterprise %} - -You can also configure allowed IP addresses for an individual organization. For more information, see "[Managing allowed IP addresses for your organization](/organizations/keeping-your-organization-secure/managing-allowed-ip-addresses-for-your-organization)." - -### Adding an allowed IP address - -{% data reusables.identity-and-permissions.about-adding-ip-allow-list-entries %} - -{% data reusables.identity-and-permissions.ipv6-allow-lists %} - -{% data reusables.enterprise-accounts.access-enterprise %} -{% data reusables.enterprise-accounts.settings-tab %} -{% data reusables.enterprise-accounts.security-tab %} -{% data reusables.identity-and-permissions.ip-allow-lists-add-ip %} -{% data reusables.identity-and-permissions.ip-allow-lists-add-description %} -{% data reusables.identity-and-permissions.ip-allow-lists-add-entry %} -{% data reusables.identity-and-permissions.check-ip-address %} - -### Allowing access by {% data variables.product.prodname_github_apps %} - -{% data reusables.identity-and-permissions.ip-allow-lists-githubapps-enterprise %} - -### Enabling allowed IP addresses - -{% data reusables.identity-and-permissions.about-enabling-allowed-ip-addresses %} - -{% data reusables.enterprise-accounts.access-enterprise %} -{% data reusables.enterprise-accounts.settings-tab %} -{% data reusables.enterprise-accounts.security-tab %} -3. Under "IP allow list", select **Enable IP allow list**. - ![Checkbox to allow IP addresses](/assets/images/help/security/enable-ip-allowlist-enterprise-checkbox.png) -4. Click **Save**. - -### Editing an allowed IP address - -{% data reusables.identity-and-permissions.about-editing-ip-allow-list-entries %} - -{% data reusables.enterprise-accounts.access-enterprise %} -{% data reusables.enterprise-accounts.settings-tab %} -{% data reusables.enterprise-accounts.security-tab %} -{% data reusables.identity-and-permissions.ip-allow-lists-edit-entry %} -{% data reusables.identity-and-permissions.ip-allow-lists-edit-ip %} -{% data reusables.identity-and-permissions.ip-allow-lists-edit-description %} -8. Click **Update**. -{% data reusables.identity-and-permissions.check-ip-address %} - -{% ifversion ip-allow-list-address-check %} -### Checking if an IP address is permitted - -{% data reusables.identity-and-permissions.about-checking-ip-address %} - -{% data reusables.enterprise-accounts.access-enterprise %} -{% data reusables.enterprise-accounts.settings-tab %} -{% data reusables.enterprise-accounts.security-tab %} -{% data reusables.identity-and-permissions.check-ip-address-step %} -{% endif %} - -### Deleting an allowed IP address - -{% data reusables.enterprise-accounts.access-enterprise %} -{% data reusables.enterprise-accounts.settings-tab %} -{% data reusables.enterprise-accounts.security-tab %} -{% data reusables.identity-and-permissions.ip-allow-lists-delete-entry %} -{% data reusables.identity-and-permissions.ip-allow-lists-confirm-deletion %} - -### Using {% data variables.product.prodname_actions %} with an IP allow list - -{% data reusables.actions.ip-allow-list-self-hosted-runners %} - -{% endif %} - -{% endif %} - ## Managing SSH certificate authorities for your enterprise You can use a SSH certificate authorities (CA) to allow members of any organization owned by your enterprise to access that organization's repositories using SSH certificates you provide. {% data reusables.organizations.can-require-ssh-cert %} For more information, see "[About SSH certificate authorities](/organizations/managing-git-access-to-your-organizations-repositories/about-ssh-certificate-authorities)." @@ -197,5 +110,7 @@ To prevent confusion from your developers, you can change this behavior so that ## Further reading - "[About identity and access management for your enterprise](/admin/authentication/managing-identity-and-access-for-your-enterprise/about-identity-and-access-management-for-your-enterprise)"{% ifversion ghec %} -- "[Accessing compliance reports for your enterprise](/admin/overview/accessing-compliance-reports-for-your-enterprise)"{% endif %} -{% endif %} +- "[Accessing compliance reports for your enterprise](/admin/overview/accessing-compliance-reports-for-your-enterprise)"{%- endif %} +- "[Keeping your organization secure](/organizations/keeping-your-organization-secure)" +- "[Restricting network traffic with an IP allow list with an IP allow list](/admin/configuration/configuring-your-enterprise/restricting-network-traffic-to-your-enterprise-with-an-ip-allow-list)" +{%- endif %} diff --git a/translations/zh-CN/content/authentication/authenticating-with-saml-single-sign-on/viewing-and-managing-your-active-saml-sessions.md b/translations/zh-CN/content/authentication/authenticating-with-saml-single-sign-on/viewing-and-managing-your-active-saml-sessions.md index cf62edb6c3..2f65e2717f 100644 --- a/translations/zh-CN/content/authentication/authenticating-with-saml-single-sign-on/viewing-and-managing-your-active-saml-sessions.md +++ b/translations/zh-CN/content/authentication/authenticating-with-saml-single-sign-on/viewing-and-managing-your-active-saml-sessions.md @@ -1,6 +1,6 @@ --- -title: Viewing and managing your active SAML sessions -intro: You can view and revoke your active SAML sessions in your settings. +title: 查看和管理活动的 SAML 会话 +intro: 可以在设置中查看和撤销活动的 SAML 会话。 redirect_from: - /articles/viewing-and-managing-your-active-saml-sessions - /github/authenticating-to-github/viewing-and-managing-your-active-saml-sessions @@ -11,29 +11,33 @@ topics: - SSO type: how_to shortTitle: Active SAML sessions +ms.openlocfilehash: e69ad366de7cdfb14b6a2a13ae3bdc134111616a +ms.sourcegitcommit: b2e5d14036a700b781e91158a552f8c0b1f04839 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/15/2022 +ms.locfileid: '148165577' --- +可以查看已登录到帐户的设备列表,并撤销无法识别的任何 SAML 会话。 -You can view a list of devices that have logged into your account, and revoke any SAML sessions that you don't recognize. +{% data reusables.user-settings.access_settings %} {% data reusables.user-settings.sessions %} +1. 在“Web 会话”下,可以看到活动的 SAML 会话。 -{% data reusables.user-settings.access_settings %} -{% data reusables.user-settings.sessions %} -1. Under "Web sessions," you can see your active SAML sessions. + ![活动 SAML 会话列表的屏幕截图](/assets/images/help/settings/saml-active-sessions.png) - ![Screenshot of the list of active SAML sessions](/assets/images/help/settings/saml-active-sessions.png) +1. 若要查看会话详细信息,请单击“查看更多”。 + ![活动 SAML 会话的屏幕截图,其中突出显示了用于打开 SAML 会话详细信息的按钮](/assets/images/help/settings/saml-expand-session-details.png) -1. To see the session details, click **See more**. - ![Screenshot of the active SAML sessions with the button to open SAML session details emphasized](/assets/images/help/settings/saml-expand-session-details.png) +1. 若要撤销会话,请单击“撤销 SAML”。 -1. To revoke a session, click **Revoke SAML**. - - ![Screenshot of the Session details page with the button to revoke a SAML session emphasized](/assets/images/help/settings/saml-revoke-session.png) + ![“会话详细信息”页的屏幕截图,其中突出显示了用于撤销 SAML 会话的按钮](/assets/images/help/settings/saml-revoke-session.png) {% note %} - **Note:** When you revoke a session, you remove your SAML authentication to that organization. To access the organization again, you will need to single sign-on through your identity provider. For more information, see "[About authentication with SAML SSO](/github/authenticating-to-github/about-authentication-with-saml-single-sign-on)." + **注意:** 撤销会话时,将删除对该组织的 SAML 身份验证。 要再次访问该组织,您需要通过身份提供程序单点登录。 有关详细信息,请参阅“[关于通过 SAML SSO 进行身份验证](/github/authenticating-to-github/about-authentication-with-saml-single-sign-on)”。 {% endnote %} -## Further reading +## 延伸阅读 -- "[About authentication with SAML SSO](/github/authenticating-to-github/about-authentication-with-saml-single-sign-on)" +- “[关于使用 SAML SSO 进行身份验证](/github/authenticating-to-github/about-authentication-with-saml-single-sign-on)” diff --git a/translations/zh-CN/content/authentication/keeping-your-account-and-data-secure/index.md b/translations/zh-CN/content/authentication/keeping-your-account-and-data-secure/index.md index b2431aab33..0b0cb59457 100644 --- a/translations/zh-CN/content/authentication/keeping-your-account-and-data-secure/index.md +++ b/translations/zh-CN/content/authentication/keeping-your-account-and-data-secure/index.md @@ -1,6 +1,6 @@ --- -title: Keeping your account and data secure -intro: 'To protect your personal information, you should keep both your account on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.location.product_location %}{% endif %} and any associated data secure.' +title: 保护帐户和数据安全 +intro: '为了保护个人信息,应该确保你在 {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.location.product_location %}{% endif %} 上的帐户和任何相关数据的安全。' redirect_from: - /articles/keeping-your-account-and-data-secure - /github/authenticating-to-github/keeping-your-account-and-data-secure @@ -34,5 +34,11 @@ children: - /preventing-unauthorized-access - /viewing-and-managing-your-sessions shortTitle: Account security +ms.openlocfilehash: ba88c5fcde2e1dcdcf7186c4e5d83bf854f9ff00 +ms.sourcegitcommit: b2e5d14036a700b781e91158a552f8c0b1f04839 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/15/2022 +ms.locfileid: '148165544' --- diff --git a/translations/zh-CN/content/authentication/keeping-your-account-and-data-secure/viewing-and-managing-your-sessions.md b/translations/zh-CN/content/authentication/keeping-your-account-and-data-secure/viewing-and-managing-your-sessions.md new file mode 100644 index 0000000000..5994c0097c --- /dev/null +++ b/translations/zh-CN/content/authentication/keeping-your-account-and-data-secure/viewing-and-managing-your-sessions.md @@ -0,0 +1,46 @@ +--- +title: 查看和管理会话 +intro: 可以在设置中查看和撤销活动的会话。 +versions: + feature: device-and-settings-management-page +type: how_to +topics: + - SSO +shortTitle: Viewing and managing sessions +ms.openlocfilehash: 15a0bdc17a913ceb6da27e8809610306adb1de25 +ms.sourcegitcommit: b2e5d14036a700b781e91158a552f8c0b1f04839 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/15/2022 +ms.locfileid: '148165575' +--- +可以查看已登录到帐户的设备列表,并撤销无法识别的任何会话。 + +{% data reusables.user-settings.access_settings %} {% data reusables.user-settings.sessions %} +1. 在“Web 会话”下,可以看到活动的 Web 会话。 + + ![活动会话列表的屏幕截图](/assets/images/help/settings/saml-active-sessions.png) {% ifversion fpt or ghec %}在 “{% data variables.product.prodname_mobile %} 会话”下,可以看到通过 {% data variables.product.prodname_mobile %} 应用登录到帐户的设备列表。 + + ![活动会话列表的屏幕截图](/assets/images/help/settings/github-mobile-active-sessions.png){% endif %} + +1. 若要查看 Web 会话详细信息,请单击“查看更多”。 + + ![“会话”页的屏幕截图,其中突出显示了用于打开会话详细信息的按钮](/assets/images/help/settings/saml-expand-session-details.png) + +1. 若要撤销 Web 会话,请单击“撤销会话”。 + + ![“会话详细信息”页的屏幕截图,其中突出显示了用于撤销会话的按钮](/assets/images/help/settings/revoke-session.png) + +{% ifversion fpt or ghec %} +1. (可选)若要撤销 {% data variables.product.prodname_mobile %} 会话,请返回到“会话概述”页面,然后单击要撤销的设备旁边的“撤销”。 + + {% note %} + + 注意:撤销移动会话会使你从该设备上退出 {% data variables.product.prodname_mobile %} 应用程序,并将其作为第二因素选项移除。 + + {% endnote %} + + ![“会话”页的屏幕截图,其中突出显示了用于撤销移动会话的按钮](/assets/images/help/settings/revoke-mobile-session.png) + +{% endif %} + diff --git a/translations/zh-CN/content/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key.md b/translations/zh-CN/content/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key.md index 6eccb1a0e3..15837294e8 100644 --- a/translations/zh-CN/content/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key.md +++ b/translations/zh-CN/content/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key.md @@ -1,6 +1,6 @@ --- -title: 将您的签名密钥告知 Git -intro: '要在本地对提交进行签名,需要向 Git 通知你要使用的 GPG{% ifversion ssh-commit-verification %}、SSH{% endif %} 或 X.509 密钥。' +title: Telling Git about your signing key +intro: 'To sign commits locally, you need to inform Git that there''s a GPG{% ifversion ssh-commit-verification %}, SSH,{% endif %} or X.509 key you''d like to use.' redirect_from: - /articles/telling-git-about-your-gpg-key - /articles/telling-git-about-your-signing-key @@ -15,39 +15,38 @@ topics: - Identity - Access management shortTitle: Tell Git your signing key -ms.openlocfilehash: e78306bb1519f2b7f51ab6bc039bff0b982e48cf -ms.sourcegitcommit: a0ad3bfe2a99c3092e76ca9b3d476cf30988ca55 -ms.translationtype: HT -ms.contentlocale: zh-CN -ms.lasthandoff: 10/28/2022 -ms.locfileid: '148118993' --- {% mac %} -## 将您的 GPG 密钥告知 Git +## Telling Git about your GPG key -如果您使用与您的提交者身份以及 {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.location.product_location %}{% endif %} 上帐户关联的已验证电子邮件地址相匹配的 GPG 密钥,则可以开始对提交和标签进行签名。 +If you're using a GPG key that matches your committer identity and your verified email address associated with your account on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.location.product_location %}{% endif %}, then you can begin signing commits and signing tags. {% note %} -如果您没有与提交者身份匹配的 GPG 密钥,则需要将电子邮件与现有密钥关联。 有关详细信息,请参阅“[将电子邮件与 GPG 密钥关联](/articles/associating-an-email-with-your-gpg-key)”。 +If you don't have a GPG key that matches your committer identity, you need to associate an email with an existing key. For more information, see "[Associating an email with your GPG key](/articles/associating-an-email-with-your-gpg-key)". {% endnote %} -如果您有多个 GPG 密钥,则需要告知 Git 要使用哪一个。 +If you have multiple GPG keys, you need to tell Git which one to use. -{% data reusables.command_line.open_the_multi_os_terminal %} {% data reusables.gpg.configure-gpg-signing %} {% data reusables.gpg.list-keys-with-note %} {% data reusables.gpg.copy-gpg-key-id %} {% data reusables.gpg.paste-gpg-key-id %} {% data reusables.gpg.set-auto-sign %} -1. 如果没有使用 GPG 套件,请在 `zsh` shell 中运行以下命令,将 GPG 密钥添加到 `.zshrc` 文件(如果存在)或 `.zprofile` 文件: +{% data reusables.command_line.open_the_multi_os_terminal %} +{% data reusables.gpg.configure-gpg-signing %} +{% data reusables.gpg.list-keys-with-note %} +{% data reusables.gpg.copy-gpg-key-id %} +{% data reusables.gpg.paste-gpg-key-id %} +{% data reusables.gpg.set-auto-sign %} +1. If you aren't using the GPG suite, run the following command in the `zsh` shell to add the GPG key to your `.zshrc` file, if it exists, or your `.zprofile` file: ```shell $ if [ -r ~/.zshrc ]; then echo 'export GPG_TTY=$(tty)' >> ~/.zshrc; \ else echo 'export GPG_TTY=$(tty)' >> ~/.zprofile; fi ``` - 或者,如果使用 `bash` shell,请运行以下命令: + Alternatively, if you use the `bash` shell, run this command: ```shell $ if [ -r ~/.bash_profile ]; then echo 'export GPG_TTY=$(tty)' >> ~/.bash_profile; \ else echo 'export GPG_TTY=$(tty)' >> ~/.profile; fi ``` -1. (可选)若要在需要时提示你输入 PIN 或密码,请安装 `pinentry-mac`。 例如,使用 [Homebrew](https://brew.sh/): +1. Optionally, to prompt you to enter a PIN or passphrase when required, install `pinentry-mac`. For example, using [Homebrew](https://brew.sh/): ```shell $ brew install pinentry-mac $ echo "pinentry-program $(which pinentry-mac)" >> ~/.gnupg/gpg-agent.conf @@ -58,56 +57,69 @@ ms.locfileid: '148118993' {% windows %} -## 将您的 GPG 密钥告知 Git +## Telling Git about your GPG key -如果您使用与您的提交者身份以及 {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.location.product_location %}{% endif %} 上帐户关联的已验证电子邮件地址相匹配的 GPG 密钥,则可以开始对提交和标签进行签名。 +If you're using a GPG key that matches your committer identity and your verified email address associated with your account on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.location.product_location %}{% endif %}, then you can begin signing commits and signing tags. {% note %} -如果您没有与提交者身份匹配的 GPG 密钥,则需要将电子邮件与现有密钥关联。 有关详细信息,请参阅“[将电子邮件与 GPG 密钥关联](/articles/associating-an-email-with-your-gpg-key)”。 +If you don't have a GPG key that matches your committer identity, you need to associate an email with an existing key. For more information, see "[Associating an email with your GPG key](/articles/associating-an-email-with-your-gpg-key)". {% endnote %} -如果您有多个 GPG 密钥,则需要告知 Git 要使用哪一个。 +If you have multiple GPG keys, you need to tell Git which one to use. -{% data reusables.command_line.open_the_multi_os_terminal %} {% data reusables.gpg.configure-gpg-signing %} {% data reusables.gpg.list-keys-with-note %} {% data reusables.gpg.copy-gpg-key-id %} {% data reusables.gpg.paste-gpg-key-id %} {% data reusables.gpg.set-auto-sign %} +{% data reusables.command_line.open_the_multi_os_terminal %} +{% data reusables.gpg.configure-gpg-signing %} +{% data reusables.gpg.list-keys-with-note %} +{% data reusables.gpg.copy-gpg-key-id %} +{% data reusables.gpg.paste-gpg-key-id %} +{% data reusables.gpg.set-auto-sign %} {% endwindows %} {% linux %} -## 将您的 GPG 密钥告知 Git +## Telling Git about your GPG key -如果您使用与您的提交者身份以及 {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.location.product_location %}{% endif %} 上帐户关联的已验证电子邮件地址相匹配的 GPG 密钥,则可以开始对提交和标签进行签名。 +If you're using a GPG key that matches your committer identity and your verified email address associated with your account on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.location.product_location %}{% endif %}, then you can begin signing commits and signing tags. {% note %} -如果您没有与提交者身份匹配的 GPG 密钥,则需要将电子邮件与现有密钥关联。 有关详细信息,请参阅“[将电子邮件与 GPG 密钥关联](/articles/associating-an-email-with-your-gpg-key)”。 +If you don't have a GPG key that matches your committer identity, you need to associate an email with an existing key. For more information, see "[Associating an email with your GPG key](/articles/associating-an-email-with-your-gpg-key)". {% endnote %} -如果您有多个 GPG 密钥,则需要告知 Git 要使用哪一个。 +If you have multiple GPG keys, you need to tell Git which one to use. -{% data reusables.command_line.open_the_multi_os_terminal %} {% data reusables.gpg.configure-gpg-signing %} {% data reusables.gpg.list-keys-with-note %} {% data reusables.gpg.copy-gpg-key-id %} {% data reusables.gpg.paste-gpg-key-id %} {% data reusables.gpg.set-auto-sign %} -1. 若要将 GPG 密钥添加到 `.bashrc` 启动文件,请运行以下命令: +{% data reusables.command_line.open_the_multi_os_terminal %} +{% data reusables.gpg.configure-gpg-signing %} +{% data reusables.gpg.list-keys-with-note %} +{% data reusables.gpg.copy-gpg-key-id %} +{% data reusables.gpg.paste-gpg-key-id %} +{% data reusables.gpg.set-auto-sign %} +1. To add your GPG key to your `.bashrc` startup file, run the following command: ```bash $ [ -f ~/.bashrc ] && echo 'export GPG_TTY=$(tty)' >> ~/.bashrc ``` -{% endlinux %} {% ifversion ssh-commit-verification %} +{% endlinux %} +{% ifversion ssh-commit-verification %} -## 将 SSH 密钥告知 Git +## Telling Git about your SSH key -可以使用现有 SSH 密钥对提交和标记进行签名,或生成专用于签名的新密钥。 有关详细信息,请参阅“[生成新的 SSH 密钥并将其添加到 ssh-agent](/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)”。 +You can use an existing SSH key to sign commits and tags, or generate a new one specifically for signing. For more information, see "[Generating a new SSH key and adding it to the ssh-agent](/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)." {% data reusables.gpg.ssh-git-version %} -{% data reusables.command_line.open_the_multi_os_terminal %} {% data reusables.gpg.configure-ssh-signing %} {% data reusables.gpg.copy-ssh-public-key %} {% data reusables.gpg.paste-ssh-public-key %} +{% data reusables.command_line.open_the_multi_os_terminal %} +{% data reusables.gpg.configure-ssh-signing %} +{% data reusables.gpg.paste-ssh-public-key %} {% endif %} {% data reusables.gpg.x-509-key %} -## 延伸阅读 +## Further reading -- “[为 GitHub 帐户添加新的 SSH 密钥](/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)”。 -- [对提交签名](/articles/signing-commits) -- [对标记签名](/articles/signing-tags) +- "[Adding a new SSH key to your GitHub account](/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)." +- "[Signing commits](/articles/signing-commits)" +- "[Signing tags](/articles/signing-tags)" diff --git a/translations/zh-CN/content/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication.md b/translations/zh-CN/content/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication.md index ec06abf702..70d3938722 100644 --- a/translations/zh-CN/content/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication.md +++ b/translations/zh-CN/content/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication.md @@ -52,30 +52,24 @@ A time-based one-time password (TOTP) application automatically generates an aut {% data reusables.user-settings.access_settings %} {% data reusables.user-settings.security %} {% data reusables.two_fa.enable-two-factor-authentication %} -{%- ifversion fpt or ghec or ghes %} +{%- ifversion fpt or ghec or ghes > 3.7 %} +5. Under "Setup authenticator app", do one of the following: + - Scan the QR code with your mobile device's app. After scanning, the app displays a six-digit code that you can enter on {% data variables.product.product_name %}. + - If you can't scan the QR code, click **enter this text code** to see a code that you can manually enter in your TOTP app instead. + ![Click enter this code](/assets/images/help/2fa/2fa_wizard_app_click_code.png) +6. The TOTP mobile application saves your account on {% data variables.location.product_location %} and generates a new authentication code every few seconds. On {% data variables.product.product_name %}, type the code into the field under "Enter the six-digit code from the application". +![TOTP enter code field](/assets/images/help/2fa/2fa_wizard_app_enter_code.png) +{%- else %} 5. Under "Two-factor authentication", select **Set up using an app** and click **Continue**. 6. Under "Authentication verification", do one of the following: - Scan the QR code with your mobile device's app. After scanning, the app displays a six-digit code that you can enter on {% data variables.product.product_name %}. - If you can't scan the QR code, click **enter this text code** to see a code that you can manually enter in your TOTP app instead. ![Click enter this code](/assets/images/help/2fa/2fa_wizard_app_click_code.png) -7. The TOTP mobile application saves your account on {% data variables.location.product_location %} and generates a new authentication code every few seconds. On {% data variables.product.product_name %}, type the code into the field under "Enter the six-digit code from the application". If your recovery codes are not automatically displayed, click **Continue**. +7. The TOTP mobile application saves your account on {% data variables.location.product_location %} and generates a new authentication code every few seconds. On {% data variables.product.product_name %}, type the code into the field under "Enter the six-digit code from the application". ![TOTP enter code field](/assets/images/help/2fa/2fa_wizard_app_enter_code.png) -{% data reusables.two_fa.save_your_recovery_codes_during_2fa_setup %} -{%- else %} -5. On the Two-factor authentication page, click **Set up using an app**. -6. Save your recovery codes in a safe place. Your recovery codes can help you get back into your account if you lose access. - - To save your recovery codes on your device, click **Download**. - - To save a hard copy of your recovery codes, click **Print**. - - To copy your recovery codes for storage in a password manager, click **Copy**. - ![List of recovery codes with option to download, print, or copy the codes](/assets/images/help/2fa/download-print-or-copy-recovery-codes-before-continuing.png) -7. After saving your two-factor recovery codes, click **Next**. -8. On the Two-factor authentication page, do one of the following: - - Scan the QR code with your mobile device's app. After scanning, the app displays a six-digit code that you can enter on {% data variables.product.product_name %}. - - If you can't scan the QR code, click **enter this text code** to see a code you can copy and manually enter on {% data variables.product.product_name %} instead. - ![Click enter this code](/assets/images/help/2fa/totp-click-enter-code.png) -9. The TOTP mobile application saves your account on {% data variables.location.product_location %} and generates a new authentication code every few seconds. On {% data variables.product.product_name %}, on the 2FA page, type the code and click **Enable**. - ![TOTP Enable field](/assets/images/help/2fa/totp-enter-code.png) {%- endif %} +{% data reusables.two_fa.save_your_recovery_codes_during_2fa_setup %} +{% data reusables.two_fa.backup_options_during_2fa_enrollment %} {% data reusables.two_fa.test_2fa_immediately %} {% ifversion fpt or ghec %} @@ -95,8 +89,11 @@ Before using this method, be sure that you can receive text messages. Carrier ra {% data reusables.user-settings.access_settings %} {% data reusables.user-settings.security %} {% data reusables.two_fa.enable-two-factor-authentication %} -4. Under "Two-factor authentication", select **Set up using SMS** and click **Continue**. -5. Under "Authentication verification", select your country code and type your mobile phone number, including the area code. When your information is correct, click **Send authentication code**. +4. Below "Setup authenticator app", select **SMS authentication** + + ![2FA SMS alternative option](/assets/images/help/2fa/2fa_sms_alt_option.png) + +5. Under "Setup SMS authentication", select your country code and type your mobile phone number, including the area code. When your information is correct, click **Send authentication code**. ![2FA SMS screen](/assets/images/help/2fa/2fa_wizard_sms_send.png) @@ -104,6 +101,7 @@ Before using this method, be sure that you can receive text messages. Carrier ra ![2FA SMS continue field](/assets/images/help/2fa/2fa_wizard_sms_enter_code.png) {% data reusables.two_fa.save_your_recovery_codes_during_2fa_setup %} +{% data reusables.two_fa.backup_options_during_2fa_enrollment %} {% data reusables.two_fa.test_2fa_immediately %} {% endif %} @@ -128,8 +126,7 @@ Authentication with a security key is *secondary* to authentication with a TOTP ![Providing a nickname for a security key](/assets/images/help/2fa/security-key-nickname.png) 8. Activate your security key, following your security key's documentation. ![Prompt for a security key](/assets/images/help/2fa/security-key-prompt.png) -9. Confirm that you've downloaded and can access your recovery codes. If you haven't already, or if you'd like to generate another set of codes, download your codes and save them in a safe place. If you lose access to your account, you can use your recovery codes to get back into your account. For more information, see "[Recovering your account if you lose your 2FA credentials](/articles/recovering-your-account-if-you-lose-your-2fa-credentials)." - ![Download recovery codes button](/assets/images/help/2fa/2fa-recover-during-setup.png) +9. Confirm that you've downloaded and can access your recovery codes. If you haven't already, or if you'd like to generate another set of codes, download your codes and save them in a safe place. For more information, see "[Downloading your 2FA recovery codes](/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication-recovery-methods#downloading-your-two-factor-authentication-recovery-codes)." {% data reusables.two_fa.test_2fa_immediately %} {% ifversion fpt or ghec %} diff --git a/translations/zh-CN/content/billing/managing-billing-for-github-codespaces/index.md b/translations/zh-CN/content/billing/managing-billing-for-github-codespaces/index.md index d38eeec17c..4dc6cec7f3 100644 --- a/translations/zh-CN/content/billing/managing-billing-for-github-codespaces/index.md +++ b/translations/zh-CN/content/billing/managing-billing-for-github-codespaces/index.md @@ -1,7 +1,7 @@ --- -title: Managing billing for GitHub Codespaces +title: 管理 GitHub Codespaces 的计费 shortTitle: Codespaces -intro: 'You can view your usage and set a spending limit for {% data variables.product.prodname_github_codespaces %}.' +intro: '你可以查看 {% data variables.product.prodname_github_codespaces %} 的使用情况并设置支出限制。' versions: fpt: '*' ghec: '*' @@ -9,5 +9,11 @@ children: - /about-billing-for-github-codespaces - /viewing-your-github-codespaces-usage - /managing-the-spending-limit-for-github-codespaces +ms.openlocfilehash: 869239aefd5a2d244e7ff70735ad814802ed2616 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159091' --- diff --git a/translations/zh-CN/content/billing/managing-billing-for-github-codespaces/managing-the-spending-limit-for-github-codespaces.md b/translations/zh-CN/content/billing/managing-billing-for-github-codespaces/managing-the-spending-limit-for-github-codespaces.md new file mode 100644 index 0000000000..72a8e60177 --- /dev/null +++ b/translations/zh-CN/content/billing/managing-billing-for-github-codespaces/managing-the-spending-limit-for-github-codespaces.md @@ -0,0 +1,86 @@ +--- +title: 管理 GitHub Codespaces 的支出限制 +intro: '可以为 {% data variables.product.prodname_github_codespaces %} 的使用设置支出限制。' +shortTitle: Spending limit +versions: + fpt: '*' + ghec: '*' +type: how_to +topics: + - Codespaces + - Enterprise + - Organizations + - Spending limits + - User account + - Billing +redirect_from: + - /billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces + - /billing/managing-billing-for-github-codespaces/managing-spending-limits-for-github-codespaces +ms.openlocfilehash: 87dd5204bb41ddaef911562cfb4662125e04139a +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159789' +--- +## 关于 {% data variables.product.prodname_github_codespaces %} 的支出限制 + +{% data reusables.codespaces.codespaces-free-for-personal-intro %} 有关详细信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)。” + +{% data reusables.codespaces.codespaces-spending-limit-requirement %} {% data reusables.codespaces.codespaces-monthly-billing %} + +达到支出限制后,将无法再创建新的 codespace,也无法启动现有的 codespace。 仍在运行的任何现有 codespace 将在不久后关闭,但在达到支出限制后,不会向你收取使用费。 + +{% ifversion ghec %} +## 使用 Azure 订阅 +如果通过 Microsoft 企业协议购买 {% data variables.product.prodname_enterprise %},可以将 Azure 订阅 ID 连接到企业帐户,以启用并支付 {% data variables.product.prodname_github_codespaces %} 使用费用。 有关详细信息,请参阅“[将 Azure 订阅连接到企业](/billing/managing-billing-for-your-github-account/connecting-an-azure-subscription-to-your-enterprise)”。 +{% endif %} + +## 管理个人帐户的 {% data variables.product.prodname_github_codespaces %} 支出限制 + +可以为个人帐户的 {% data variables.product.prodname_github_codespaces %} 设置支出限制。 + +{% data reusables.user-settings.access_settings %} {% data reusables.user-settings.billing_plans %} {% data reusables.dotcom_billing.manage-spending-limit %} {% data reusables.codespaces.monthly-spending-limit-codespaces %} {% data reusables.dotcom_billing.update-spending-limit %} + +## 管理组织帐户的 {% data variables.product.prodname_github_codespaces %} 支出限制 + +组织所有者和帐单管理员可管理组织的 {% data variables.product.prodname_github_codespaces %} 支出限制。 + +{% note %} + +注意:企业帐户拥有的组织不能指定其自己的支出限制,因为这是在企业设置中指定的。 + +{% endnote %} + +{% data reusables.organizations.billing-settings %} {% data reusables.dotcom_billing.manage-spending-limit %} {% data reusables.codespaces.monthly-spending-limit-codespaces %} {% data reusables.dotcom_billing.update-spending-limit %} + +{% ifversion ghec %} +## 管理企业帐户的 {% data variables.product.prodname_github_codespaces %} 支出限制 + +企业所有者和账单管理员可以管理企业帐户的 {% data variables.product.prodname_github_codespaces %} 的支出限制。 + +{% data reusables.enterprise-accounts.access-enterprise %} {% data reusables.enterprise-accounts.settings-tab %} {% data reusables.enterprise-accounts.billing-tab %} +1. 单击“支出限制”。 + + ![“支出限制”选项卡](/assets/images/help/settings/spending-limit-tab-enterprise.png) + +{% data reusables.codespaces.monthly-spending-limit-codespaces %} {% data reusables.dotcom_billing.update-spending-limit %} {% endif %} + +## 在达到支出限制时导出更改 + +{% data reusables.codespaces.exporting-changes %} + +## 管理使用和支出限制电子邮件通知 + +当支出达到帐户支出限制的 75%、90% 和 100% 时,系统会向帐户所有者和帐单管理员发送电子邮件通知。 + +可以随时关闭这些通知,方法是导航到“计费和计划/每月支出限制”页的底部,然后清除“支出限制警报”复选框。 + +仅对于个人帐户,还可以选择关闭在已使用个人帐户中包含的 75%、90% 和 100% 免费使用量时发送的电子邮件通知。 为此,请清除“包含的资源警报”复选框。 + +![帐单邮箱通知设置的屏幕截图](/assets/images/help/codespaces/codespaces-spending-limit-notifications.png) + +## 延伸阅读 + +- “[限制对计算机类型的访问](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)” +- “[管理组织中的 {% data variables.product.prodname_github_codespaces %} 成本](/codespaces/managing-codespaces-for-your-organization/managing-the-cost-of-github-codespaces-in-your-organization)” diff --git a/translations/zh-CN/content/billing/managing-billing-for-github-codespaces/viewing-your-github-codespaces-usage.md b/translations/zh-CN/content/billing/managing-billing-for-github-codespaces/viewing-your-github-codespaces-usage.md index ad11575bec..a135e5f7c1 100644 --- a/translations/zh-CN/content/billing/managing-billing-for-github-codespaces/viewing-your-github-codespaces-usage.md +++ b/translations/zh-CN/content/billing/managing-billing-for-github-codespaces/viewing-your-github-codespaces-usage.md @@ -1,7 +1,7 @@ --- -title: Viewing your GitHub Codespaces usage +title: 查看 GitHub Codespaces 使用情况 shortTitle: Viewing your usage -intro: 'You can view the compute hours and storage used by {% data variables.product.prodname_github_codespaces %}.' +intro: '可以查看 {% data variables.product.prodname_github_codespaces %} 使用的计算小时数和存储空间。' versions: fpt: '*' ghec: '*' @@ -11,63 +11,64 @@ topics: - Billing redirect_from: - /billing/managing-billing-for-github-codespaces/viewing-your-codespaces-usage +ms.openlocfilehash: 67e29ee71b1881ee2ae6e9ca872fd7969f86afca +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158739' --- +## 查看个人帐户的 {% data variables.product.prodname_github_codespaces %} 使用情况 -## Viewing {% data variables.product.prodname_github_codespaces %} usage for your personal account +可以查看当前月度计费周期中到目前为止,个人帐户中的已使用量。 如果已设置付款方式、设置支出限制并使用了所有包含的使用量,则还可以检查当前月份的帐单。 -You can see how much of the usage included in your personal account you have used so far in the current monthly billing cycle. If you have set up a payment method, set a spending limit, and used all of your included usage, you can also check your bill for the current month. +{% data reusables.user-settings.access_settings %} {% data reusables.user-settings.billing_plans %} +1. 在“{% data variables.product.prodname_codespaces %}”下,可以查看当前计费月份到目前为止使用的 {% data variables.product.prodname_github_codespaces %} 计算使用量和 GB/月存储的核心小时数。 -{% data reusables.user-settings.access_settings %} -{% data reusables.user-settings.billing_plans %} -1. Under "{% data variables.product.prodname_codespaces %}," you can see how many core hours of {% data variables.product.prodname_github_codespaces %} compute usage and GB-months of storage you have used so far in the current billing month. + ![个人使用量的初始视图的屏幕截图](/assets/images/help/codespaces/view-personal-usage-collapsed.png) - ![Screenshot of the initial view of personal usage](/assets/images/help/codespaces/view-personal-usage-collapsed.png) + 有关“核心小时数”和“GB/月”的详细信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/enterprise-cloud@latest/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)”。 - For information about "core hours" and "GB-months," see "[About billing for {% data variables.product.prodname_github_codespaces %}](/enterprise-cloud@latest/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)." +1. (可选)单击“使用小时数”和“存储”以查看更多详细信息 。 -1. Optionally, click **Usage hours** and **Storage** to see more details. + ![个人使用量的展开视图的屏幕截图](/assets/images/help/codespaces/view-personal-usage-expanded.png) - ![Screenshot of the expanded view of personal usage](/assets/images/help/codespaces/view-personal-usage-expanded.png) + “包含”列显示本月到目前为止帐户中已使用的免费计算使用核心小时数或 GB/月存储。 “付费”列显示已使用的计费核心小时数或 GB/月存储。 这些数字每小时更新一次。 - The **Included** column shows how many of the core hours of compute usage, or GB-months of storage, included free with your account, you have used so far this month. The **Paid** column shows how many billed core hours of usage, or GB-months of storage, you have used. The figures are updated once every hour. - - In the screenshot above, the entire quota of included storage for the month has been used. When you've used all of either the included compute usage or storage (whichever is reached first), you must set up a payment method and a spending limit to continue using {% data variables.product.prodname_github_codespaces %} during the current billing month. For more information, see "[Adding or editing a payment method](/enterprise-cloud@latest/billing/managing-your-github-billing-settings/adding-or-editing-a-payment-method)" and "[Managing spending limits for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/managing-the-spending-limit-for-github-codespaces#managing-the-github-codespaces-spending-limit-for-your-personal-account)." + 在上面的屏幕截图中,已使用当月包含的存储的全部配额。 使用完所有包含的计算使用量或存储(以先达到者为准)时,必须设置付款方式和支出限制才能在当前计费月份继续使用 {% data variables.product.prodname_github_codespaces %}。 有关详细信息,请参阅“[添加或编辑付款方式](/enterprise-cloud@latest/billing/managing-your-github-billing-settings/adding-or-editing-a-payment-method)”和“[管理 {% data variables.product.prodname_github_codespaces %} 的支出限制](/billing/managing-billing-for-github-codespaces/managing-the-spending-limit-for-github-codespaces#managing-the-github-codespaces-spending-limit-for-your-personal-account)”。 {% data reusables.codespaces.usage-report-download %} -## Viewing {% data variables.product.prodname_github_codespaces %} usage for your organization account +## 查看组织帐户的 {% data variables.product.prodname_github_codespaces %} 使用情况 -Organization owners and billing managers can view {% data variables.product.prodname_github_codespaces %} usage for the organization. +组织所有者和账单管理员可查看组织的 {% data variables.product.prodname_github_codespaces %} 使用情况。 {% data reusables.organizations.billing-settings %} -1. Under "{% data variables.product.prodname_codespaces %}", view the details of the compute hours and storage used so far this month. +1. 在“{% data variables.product.prodname_codespaces %}”下,查看本月到目前为止使用的计算小时数和存储的详细信息。 - ![Screenshot of compute usage and storage details](/assets/images/help/billing/codespaces-compute-storage.png) + ![计算使用量和存储详细信息的屏幕截图](/assets/images/help/billing/codespaces-compute-storage.png) - You can also see and update your current spending limit. For more information, see "[Managing spending limits for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/managing-the-spending-limit-for-github-codespaces)." + 还可以查看和更新当前的支出限制。 有关详细信息,请参阅“[管理 {% data variables.product.prodname_github_codespaces %} 的支出限制](/billing/managing-billing-for-github-codespaces/managing-the-spending-limit-for-github-codespaces)”。 {% note %} - **Notes**: - * The costs shown here are the cumulative costs within the current monthly billing period. The metered costs for {% data variables.product.prodname_github_codespaces %} shown on this page are reset to zero at the start of each monthly billing period. Outstanding costs from previous months are not shown. - * The figures on this page are updated every hour. + **注释**: + * 此处显示的成本是当前每月计费周期内的累计成本。 此页上显示的 {% data variables.product.prodname_github_codespaces %} 的计量成本会在每月计费周期开始时重置为零。 不显示前几个月的未结成本。 + * 此页面上的数字每小时更新一次。 {% endnote %} {% data reusables.codespaces.usage-report-download %} {% ifversion ghec %} -## Viewing {% data variables.product.prodname_codespaces %} usage for your enterprise account +## 查看企业帐户的 {% data variables.product.prodname_codespaces %} 使用情况 -Enterprise owners and billing managers can view {% data variables.product.prodname_github_codespaces %} usage for an enterprise account. +企业所有者和帐单管理员可查看企业帐户的 {% data variables.product.prodname_github_codespaces %} 使用情况。 -{% data reusables.enterprise-accounts.access-enterprise %} -{% data reusables.enterprise-accounts.settings-tab %} -{% data reusables.enterprise-accounts.billing-tab %} -1. Under "{% data variables.product.prodname_codespaces %} monthly usage", view the usage details of each organization in your enterprise account. -{% data reusables.codespaces.usage-report-download %} -{% endif %} +{% data reusables.enterprise-accounts.access-enterprise %} {% data reusables.enterprise-accounts.settings-tab %} {% data reusables.enterprise-accounts.billing-tab %} +1. 在“{% data variables.product.prodname_codespaces %} 每月使用情况”下,查看企业帐户中每个组织的使用详细信息。 +{% data reusables.codespaces.usage-report-download %} {% endif %} -## Further reading +## 延伸阅读 -- "[Listing the codespaces in your organization](/codespaces/managing-codespaces-for-your-organization/listing-the-codespaces-in-your-organization)" +- “[列出组织中的 codespace](/codespaces/managing-codespaces-for-your-organization/listing-the-codespaces-in-your-organization)” diff --git a/translations/zh-CN/content/billing/managing-billing-for-github-packages/about-billing-for-github-packages.md b/translations/zh-CN/content/billing/managing-billing-for-github-packages/about-billing-for-github-packages.md index dcdfa5e6df..7ce4b006b3 100644 --- a/translations/zh-CN/content/billing/managing-billing-for-github-packages/about-billing-for-github-packages.md +++ b/translations/zh-CN/content/billing/managing-billing-for-github-packages/about-billing-for-github-packages.md @@ -57,15 +57,25 @@ For example, if your organization uses {% data variables.product.prodname_team % At the end of the month, {% data variables.product.prodname_dotcom %} rounds your data transfer to the nearest GB. -{% data variables.product.prodname_dotcom %} calculates your storage usage for each month based on hourly usage during that month. For example, if you use 3 GB of storage for 10 days of March and 12 GB for 21 days of March, your storage usage would be: +{% data variables.product.prodname_dotcom %} calculates your storage usage for each month based on hourly usage per GB during that month. For example, if you use 3 GB of storage for 10 days of March and 12 GB for 21 days of March, your storage usage would be: - 3 GB x 10 days x (24 hours per day) = 720 GB-Hours - 12 GB x 21 days x (24 hours per day) = 6,048 GB-Hours -- 720 GB-Hours + 6,048 GB-Hours = 6,768 GB-Hours +- 720 GB-Hours + 6,048 GB-Hours = 6,768 total GB-Hours - 6,768 GB-Hours / (744 hours per month) = 9.0967 GB-Months At the end of the month, {% data variables.product.prodname_dotcom %} rounds your storage to the nearest MB. Therefore, your storage usage for March would be 9.097 GB. +You can also use this calculation in the middle of a billing cycle, to estimate what your total usage might be for the month. For example, if you have an organization that uses {% data variables.product.prodname_team %}, which provides 2 GB of free storage, and you use 0 GB for the first 5 days of April, 1.5 GB for the following 10 days, and you plan to use 3 GB for the last 15 days of the billing cycle, your projected storage usage for the month would be: + +- 0 GB x 5 days x (24 hours per day) = 0 GB-Hours +- 0.5 GB x 10 days x (24 hours per day) = 120 GB-Hours +- 3 GB x 15 days x (24 hours per day) = 1080 GB-Hours +- 0 GB-Hours + 120 GB-Hours + 1080 GB-Hours = 1200 total GB-Hours +- 1200 GB-Hours / (744 hours per month) = 1.6 GB-Months + +The projected 1.6 GB of storage usage for the month would not exceed your 2 GB limit, even though your actual storage amount briefly exceeded 2 GB. + Your {% data variables.product.prodname_registry %} usage shares your account's existing billing date, payment method, and receipt. {% data reusables.dotcom_billing.view-all-subscriptions %} {% data reusables.user-settings.context_switcher %} @@ -74,6 +84,12 @@ Your {% data variables.product.prodname_registry %} usage shares your account's {% data reusables.package_registry.packages-spending-limit-detailed %} -For information on managing and changing your account's spending limit, see "[Managing your spending limit for {% data variables.product.prodname_registry %}](/billing/managing-billing-for-github-packages/managing-your-spending-limit-for-github-packages)." +To prevent exceeding your spending limit, {% data variables.product.prodname_dotcom %} checks your storage consumption continuously throughout the month by looking at your current usage and calculating what your projected usage will be at the end of the month if no changes are made before that time. If at any point during the billing cycle your projected monthly usage exceeds your spending limit, both {% data variables.product.prodname_registry %} and {% data variables.product.prodname_actions %} will be disabled to prevent overages. -{% data reusables.dotcom_billing.actions-packages-unpaid-account %} +You should set a spending limit that will cover your maximum projected storage usage at any given point in the billing cycle. For example, imagine you have an organization that uses {% data variables.product.prodname_team %}, and you set a spending limit of $50 USD. {% data variables.product.prodname_team %} provides 2 GB of free storage. For any storage you use over that amount, {% data variables.product.prodname_dotcom %} will charge $0.008 USD per GB per day, or approximately $0.25 USD per GB for a 31-day month. That means the $50 spending limit you set will pay for an extra 200 GB of storage in that period. If on day ten of the billing cycle you reach 202 GB of storage, the next push of a package or {% data variables.product.prodname_actions %} artifact will fail, because you have reached the maximum storage amount that can be paid for by your spending limit in this billing cycle, even if your average consumption for the period is below 202 GB. + +To avoid reaching your spending limit in the current billing cycle, you can delete some of your current storage usage to free up projected usage for the rest of the month. This method is more effective toward the beginning of a billing cycle. The closer you get to the end of a billing cycle, the less impact this method will have on projected monthly usage. + +For more information about managing and changing your account's spending limit, see "[Managing your spending limit for {% data variables.product.prodname_registry %}](/billing/managing-billing-for-github-packages/managing-your-spending-limit-for-github-packages)." + +{% data reusables.dotcom_billing.actions-packages-unpaid-account %} \ No newline at end of file diff --git a/translations/zh-CN/content/billing/managing-your-license-for-github-enterprise/troubleshooting-license-usage-for-github-enterprise.md b/translations/zh-CN/content/billing/managing-your-license-for-github-enterprise/troubleshooting-license-usage-for-github-enterprise.md index 7bc6979232..7a52a681b0 100644 --- a/translations/zh-CN/content/billing/managing-your-license-for-github-enterprise/troubleshooting-license-usage-for-github-enterprise.md +++ b/translations/zh-CN/content/billing/managing-your-license-for-github-enterprise/troubleshooting-license-usage-for-github-enterprise.md @@ -22,7 +22,14 @@ For privacy reasons, enterprise owners cannot directly access the details of use ## About the calculation of consumed licenses -{% data variables.product.company_short %} bills for each person who uses deployments of {% data variables.product.prodname_ghe_server %}, is a member of one of your organizations on {% data variables.product.prodname_ghe_cloud %}, or is a {% data variables.visual_studio.prodname_vs_subscriber %}. For more information about the people in your enterprise who consume a license, see "[About per-user pricing](/billing/managing-billing-for-your-github-account/about-per-user-pricing)." +If a user meets one or more of the following conditions, {% data variables.product.company_short %} bills for the user. + +- The user utilizes deployments of {% data variables.product.prodname_ghe_server %}. +- The user is a member of one of your organizations on {% data variables.product.prodname_ghe_cloud %}. +- The user has write access to one of your organization's private repositories. +- The user is a {% data variables.visual_studio.prodname_vs_subscriber %}. + +Invitations for these roles will consume a license until the invitation is accepted or expires. For more information about the people in your enterprise who consume a license, see "[About per-user pricing](/billing/managing-billing-for-your-github-account/about-per-user-pricing)." For each user to consume a single seat regardless of how many deployments they use, you must synchronize license usage between {% data variables.product.prodname_ghe_server %} and {% data variables.product.prodname_ghe_cloud %}. For more information, see "[Syncing license usage between {% data variables.product.prodname_ghe_server %} and {% data variables.product.prodname_ghe_cloud %}](/billing/managing-your-license-for-github-enterprise/syncing-license-usage-between-github-enterprise-server-and-github-enterprise-cloud)." diff --git a/translations/zh-CN/content/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates.md b/translations/zh-CN/content/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates.md index 0e0910c214..f4241ca377 100644 --- a/translations/zh-CN/content/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates.md +++ b/translations/zh-CN/content/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates.md @@ -62,7 +62,7 @@ You can also enable or disable {% data variables.product.prodname_dependabot_sec You can override the default behavior of {% data variables.product.prodname_dependabot_security_updates %} by adding a dependabot.yml file to your repository. For more information, see "[Configuration options for the dependabot.yml file](/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file)." -If you only require security updates and want to exclude version updates, you can set `open-pull-request-limit` to `0` in order to prevent version updates for a given `package-ecosystem`. For more information, see "[`open-pull-request-limit`](/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#open-pull-requests-limit)." +If you only require security updates and want to exclude version updates, you can set `open-pull-requests-limit` to `0` in order to prevent version updates for a given `package-ecosystem`. For more information, see "[`open-pull-requests-limit`](/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#open-pull-requests-limit)." ``` # Example configuration file that: diff --git a/translations/zh-CN/content/code-security/security-advisories/guidance-on-reporting-and-writing/about-coordinated-disclosure-of-security-vulnerabilities.md b/translations/zh-CN/content/code-security/security-advisories/guidance-on-reporting-and-writing/about-coordinated-disclosure-of-security-vulnerabilities.md new file mode 100644 index 0000000000..9c4080d9d7 --- /dev/null +++ b/translations/zh-CN/content/code-security/security-advisories/guidance-on-reporting-and-writing/about-coordinated-disclosure-of-security-vulnerabilities.md @@ -0,0 +1,98 @@ +--- +title: 关于安全漏洞的协调披露 +intro: 漏洞披露是安全报告者与仓库维护者之间的协调工作。 +redirect_from: + - /code-security/security-advisories/about-coordinated-disclosure-of-security-vulnerabilities + - /code-security/repository-security-advisories/about-coordinated-disclosure-of-security-vulnerabilities + - /code-security/security-advisories/repository-security-advisories/about-coordinated-disclosure-of-security-vulnerabilities +miniTocMaxHeadingLevel: 3 +versions: + fpt: '*' + ghec: '*' +type: overview +topics: + - Security advisories + - Vulnerabilities +shortTitle: Coordinated disclosure +ms.openlocfilehash: 5f3e9983b3efcca68cb1b5c0bc5891a21f276216 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159463' +--- +## 关于披露行业漏洞 + +{% data reusables.security-advisory.disclosing-vulnerabilities %} + +漏洞的初始报告是私下发布的,并且只有在维护者确认问题后才会公布全部详细信息,最好提供补救或修补程序,有时会延迟,以便有更多的时间安装修补程序。 有关详细信息,请参阅 OWASP 备忘单系列网站上的“[关于漏洞披露的 OWASP 备忘单系列](https://cheatsheetseries.owasp.org/cheatsheets/Vulnerability_Disclosure_Cheat_Sheet.html#commercial-and-open-source-software)”。 + +### 漏洞报告者的最佳实践 + +私下向维护者报告漏洞是一项良好的做法。 如果可能,作为漏洞报告者,我们建议您避免: +- 公开披露漏洞而不给维护者补救的机会。 +- 绕过维护者。 +- 在代码的修复版可用之前披露漏洞。 +- 在没有公共奖励方案的情况下,报告某个问题时期望得到补偿。 + +漏洞报告者如果已尝试联系维护者但未收到回复,或与已联系他们但被要求等待很久才能披露,则在一段时间后公开披露漏洞是可以接受的。 + +我们建议漏洞报告者在报告过程中明确说明其披露政策的条款。 即使漏洞报告者不遵守严格的政策,最好在预期漏洞披露的时间表上对维护者设定明确的期望。 有关披露策略的示例,请参阅 GitHub 安全实验室网站上的“[安全实验室披露策略](https://securitylab.github.com/advisories#policy)”。 + +### 维护者最佳实践 + +作为维护者,最佳做法是明确说明您想如何和在何处收到关于漏洞的报告。 如果此信息不可明确,但漏洞报告者不知道如何联系您,可能寻求从 git 提交历史记录中提取开发人员电子邮件地址,以尝试找到适当的安全联系人。 这可能导致摩擦、丢失报告或发布未解决的报告。 + +维护者应及时披露漏洞。 如果您的仓库存在安全漏洞,我们建议您: +- 在响应和披露中,将漏洞视为安全问题,而不是简单的错误。 例如,您需要明确提及问题在发布说明中是一个安全漏洞。 +- 即使没有即时的调查资源,也应尽快确认收到漏洞报告。 这传递了这样一个信息:您可以快速响应并采取行动,并为您与漏洞报告者之间的其余互动设定了积极的基调。 +- 当您验证报告的影响和真实性时,请让漏洞报告者参与。 漏洞报告者可能已经花时间考虑了各种情景中的漏洞,其中一些情况您自己可能都没有考虑过。 +- 以你认为合适的方式解决这个问题,认真考虑漏洞报告者提出的任何关切和建议。 通常,漏洞报告者会了解没有安全研究背景时容易错过的某些角落案例和补救旁路。 +- 始终将漏洞的发现归功于漏洞报告者。 +- 目标是尽快发布修复。 +- 确保您在披露漏洞时让更广泛的生态系统意识到问题及其补救措施。 在项目当前开发分支中修复已识别的安全问题,但提交或后续版本未明确标记为安全修复或发布的情况并不少见。 这可能给下游消费者造成问题。 + +发布安全漏洞的详细信息不会使维护者看起来很糟糕。 安全漏洞在软件中随处可见。用户会信任那些在其守则中明确制定了安全漏洞披露程序的维护者。 + +## 关于在 {% data variables.product.prodname_dotcom %} 上报告和披露项目中的漏洞 + +{% data variables.product.prodname_dotcom %} 上有两个可用的进程: + +- 标准过程:漏洞报告者使用位于存储库安全策略中的联系人信息与存储库维护人员取得联系。 然后,如有需要,存储库维护人员将创建草案存储库公告。 +- 私人漏洞报告:漏洞报告者通过提出草案存储库公告并提供其发现的详细信息,私下直接向存储库维护人员披露漏洞详细信息。 + +### 标准过程 + +在 {% data variables.product.prodname_dotcom_the_website %} 上报告和披露项目漏洞的流程如下: + + 如果您是要报告漏洞的漏洞报告者(例如安全研究人员),请先检查相关仓库是否有安全策略。 有关详细信息,请参阅“[关于安全策略](/code-security/getting-started/adding-a-security-policy-to-your-repository#about-security-policies)”。 如果有的话,请先了解该流程,然后再联系该仓库的安全团队。 + + 如果没有安全策略,与维护者建立私人通信手段的最有效办法是制造一个要求优先安全联系的问题。 值得注意的是,这个问题将立即公开可见,所以它不应该包括任何有关漏洞的信息。 建立通信后,您可以建议维护者制定安全策略以供将来使用。 + +{% note %} + +注意:如果我们收到 npm 包中的恶意软件报告,我们会尝试私下与你联系(仅适用于 npm)。 如果您不及时解决问题,我们将予以披露。 有关详细信息,请参阅 npm Docs 网站上的“[报告 npm 包中的恶意软件](https://docs.npmjs.com/reporting-malware-in-an-npm-package)”。 + +{% endnote %} + + 如果您在 {% data variables.product.prodname_dotcom_the_website %} 中发现了安全漏洞,请通过我们协调的披露流程报告该漏洞。 有关详细信息,请参阅“[{% data variables.product.prodname_dotcom %} 安全 Bug 赏金](https://bounty.github.com/)”网站。 + + 如果您是维护者, 您可以在管道开始时通过为您的仓库设置安全策略来掌控这一过程,或者以其他方式使安全报告说明清楚可用,例如在项目的 README 文件中。 有关添加安全策略的信息,请参阅“[关于安全策略](/code-security/getting-started/adding-a-security-policy-to-your-repository#about-security-policies)”。 如果没有安全策略,漏洞报告者可能会尝试向您发送电子邮件或以其他方式私下与您联系。 或者,有人可能会开一个(公共)议题讨论安全问题的细节。 + + 作为维护者,要在您的代码中披露漏洞,请先在 {% data variables.product.prodname_dotcom %} 中软件包的仓库内创建安全通告。 {% data reusables.security-advisory.security-advisory-overview %} 有关详细信息,请参阅“[关于存储库安全公告](/code-security/repository-security-advisories/about-github-security-advisories-for-repositories)”。 + + 要开始使用,请参阅“[创建存储库安全公告](/code-security/repository-security-advisories/creating-a-repository-security-advisory)”。 + +### 私人漏洞报告 + +{% data reusables.security-advisory.private-vulnerability-reporting-beta %} + +{% data reusables.security-advisory.private-vulnerability-reporting-enable %} + + 私人漏洞报告为漏洞报告者提供了一种简单的方法,可以在 {% data variables.product.prodname_dotcom %} 中向存储库维护人员私下披露安全风险,并即时将该问题告知给存储库维护人员。 有关安全研究人员和存储库维护人员的详细信息,请分别参阅“[私下报告安全漏洞](/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)”和“[管理私下报告的安全漏洞](/code-security/security-advisories/guidance-on-reporting-and-writing/managing-privately-reported-security-vulnerabilities)”。 + +{% note %} + +注意:如果包含漏洞的存储库未启用私人漏洞报告,则安全研究人员和存储库维护人员都需要按照上面“[标准过程](#standard-process)”部分中所述的说明进行操作。 + +{% endnote %} diff --git a/translations/zh-CN/content/code-security/security-advisories/guidance-on-reporting-and-writing/managing-privately-reported-security-vulnerabilities.md b/translations/zh-CN/content/code-security/security-advisories/guidance-on-reporting-and-writing/managing-privately-reported-security-vulnerabilities.md new file mode 100644 index 0000000000..d6daeb7614 --- /dev/null +++ b/translations/zh-CN/content/code-security/security-advisories/guidance-on-reporting-and-writing/managing-privately-reported-security-vulnerabilities.md @@ -0,0 +1,45 @@ +--- +title: Managing privately reported security vulnerabilities +intro: Repository maintainers can manage security vulnerabilities that have been privately reported to them by security reseachers for repositories where private vulnerability reporting is enabled. +permissions: 'Anyone with admin permissions to a repository can see, review, and manage privately-reported vulnerabilities for the repository.' +versions: + fpt: '*' + ghec: '*' +type: how_to +miniTocMaxHeadingLevel: 3 +topics: + - Security advisories + - Vulnerabilities +shortTitle: Manage vulnerability reports +--- + +{% data reusables.security-advisory.private-vulnerability-reporting-beta %} + +{% data reusables.security-advisory.private-vulnerability-reporting-enable %} + +## About privately reporting a security vulnerability + +Private vulnerability reporting makes it easy for security researchers to report vulnerabilities directly to you using a simple form. + +When a security researcher reports a vulnerability privately, you are notified and can choose to either accept it, ask more questions, or reject it. If you accept the report, you're ready to collaborate on a fix for the vulnerability in private with the security researcher. + +## Managing security vulnerabilities that are privately reported + +{% data variables.product.prodname_dotcom %} notifies repository maintainers when security researchers privately report vulnerabilities in their repository, and sends notifications if maintainers watch the repository or if they have notifications enabled for the repository. For more information, see "[Configuring notifications](/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/configuring-notifications)." + +{% data reusables.repositories.navigate-to-repo %} +{% data reusables.repositories.sidebar-security %} +{% data reusables.repositories.sidebar-advisories %} +1. Click the advisory you want to review. An advisory that is privately reported will have a status of `Needs triage`. + + ![Screenshot showing an example of advisory list](/assets/images/help/security/advisory-list.png) + +2. Carefully review the report. You can: + - Collaborate with the security researcher on a patch in private, by clicking **Start a temporary private fork**. This gives you a place for further discussions with the contributor without changing the status of the proposed advisory from `Needs triage`. + - Accept the vulnerability report as a draft advisory on {% data variables.product.prodname_dotcom %}, by clicking **Accept and open as draft**. If you choose this option: + - This doesn't make the report public. + - The report becomes a draft repository security advisory and you can work on it in the same way as any draft advisory that you create. + For more information on security advisories, see "[About repository security advisories](/code-security/security-advisories/repository-security-advisories/about-repository-security-advisories)." + - Reject the report by clicking **Close security advisory**. Where possible, you should add a comment explaining why you don't consider the report a security risk before you close the advisory. + + ![Screenshot showing the options available to the repository maintainer when reviewing an externally submitted vulnerability report](/assets/images/help/security/advisory-maintainer-options.png) \ No newline at end of file diff --git a/translations/zh-CN/content/code-security/supply-chain-security/understanding-your-software-supply-chain/configuring-dependency-review.md b/translations/zh-CN/content/code-security/supply-chain-security/understanding-your-software-supply-chain/configuring-dependency-review.md index 0f6307553b..8e9b522288 100644 --- a/translations/zh-CN/content/code-security/supply-chain-security/understanding-your-software-supply-chain/configuring-dependency-review.md +++ b/translations/zh-CN/content/code-security/supply-chain-security/understanding-your-software-supply-chain/configuring-dependency-review.md @@ -1,6 +1,6 @@ --- -title: Configuring dependency review -intro: You can use dependency review to catch vulnerabilities before they are added to your project. +title: 配置依赖项审查 +intro: 可以使用依赖项评审来捕获漏洞,以避免将其添加到项目中。 miniTocMaxHeadingLevel: 3 shortTitle: Configure dependency review versions: @@ -15,80 +15,71 @@ topics: - Vulnerabilities - Dependencies - Pull requests +ms.openlocfilehash: b5e5ccb5107cd96d1a88f896fd46d5b948a365cd +ms.sourcegitcommit: c2aa10a61db44ee111c09565b6114dd5c97b6e2e +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/14/2022 +ms.locfileid: '148163350' --- - -## About dependency review +## 关于依赖项评审 {% data reusables.dependency-review.feature-overview %} -For more information, see "[About dependency review](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review)" and "[Reviewing dependency changes in a pull request](/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-dependency-changes-in-a-pull-request)." +有关详细信息,请参阅“[关于依赖项审查](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review)”和“[审查拉取请求中的依赖项更改](/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-dependency-changes-in-a-pull-request)”。 -## About configuring dependency review +## 关于配置依赖项审查 -{% ifversion fpt %} -Dependency review is available in all public repositories in all products and cannot be disabled. Dependency review is available in private repositories owned by organizations that use GitHub Enterprise Cloud and have a license for [{% data variables.product.prodname_GH_advanced_security %}](/get-started/learning-about-github/about-github-advanced-security). For more information, see the [{% data variables.product.prodname_ghe_cloud %} documentation](/enterprise-cloud@latest/code-security/supply-chain-security/understanding-your-software-supply-chain/configuring-dependency-review). +{% ifversion fpt %} 依赖项审查在所有产品的所有公共存储库中都可用,并且无法禁用。 依赖项审查在使用 GitHub Enterprise Cloud 并拥有 [{% data variables.product.prodname_GH_advanced_security %}](/get-started/learning-about-github/about-github-advanced-security) 许可证的组织拥有的专用存储库中可用。 有关详细信息,请参阅 [{% data variables.product.prodname_ghe_cloud %} 文档](/enterprise-cloud@latest/code-security/supply-chain-security/understanding-your-software-supply-chain/configuring-dependency-review)。 -{% elsif ghec %} -Dependency review is included in {% data variables.product.product_name %} for public repositories. To use dependency review in private repositories owned by organizations, you must have a license for [{% data variables.product.prodname_GH_advanced_security %}](/get-started/learning-about-github/about-github-advanced-security) and have the dependency graph enabled. +{% elsif ghec %} 依赖项审查包含在公共存储库的 {% data variables.product.product_name %} 中。 若要在组织拥有的专用存储库中使用依赖项审查,必须具有 [{% data variables.product.prodname_GH_advanced_security %}](/get-started/learning-about-github/about-github-advanced-security) 许可证并启用依赖项关系图。 {% data reusables.dependabot.enabling-disabling-dependency-graph-private-repo %} -1. If "{% data variables.product.prodname_GH_advanced_security %}" is not enabled, click **Enable** next to the feature. - ![Screenshot of GitHub Advanced Security feature with "Enable" button emphasized](/assets/images/help/security/enable-ghas-private-repo.png) +1. 如果尚未启用“{% data variables.product.prodname_GH_advanced_security %}”,请单击此功能旁边的“启用”。 + ![GitHub 高级安全功能的屏幕截图,其中突出显示了“启用”按钮](/assets/images/help/security/enable-ghas-private-repo.png) {% elsif ghes or ghae %} -Dependency review is available when dependency graph is enabled for {% data variables.location.product_location %} and {% data variables.product.prodname_advanced_security %} is enabled for the organization or repository.{% ifversion ghes %} For more information, see "[Enabling {% data variables.product.prodname_GH_advanced_security %} for your enterprise](/admin/code-security/managing-github-advanced-security-for-your-enterprise/enabling-github-advanced-security-for-your-enterprise)."{% endif %} +为 {% data variables.location.product_location %} 启用依赖项关系图并且为组织或存储库启用 {% data variables.product.prodname_advanced_security %} 时,依赖项审查可用。{% ifversion ghes %} 有关详细信息,请参阅“[为企业启用 {% data variables.product.prodname_GH_advanced_security %}](/admin/code-security/managing-github-advanced-security-for-your-enterprise/enabling-github-advanced-security-for-your-enterprise)”。{% endif %} -### Checking if the dependency graph is enabled +### 检查是否已启用依赖项关系图 -{% data reusables.repositories.navigate-to-repo %} -{% data reusables.repositories.sidebar-settings %} -{% data reusables.repositories.navigate-to-code-security-and-analysis %} -1. Under "Configure security and analysis features", check if the dependency graph is enabled. -1. If dependency graph is enabled, click **Enable** next to "{% data variables.product.prodname_GH_advanced_security %}" to enable {% data variables.product.prodname_advanced_security %}, including dependency review. The enable button is disabled if your enterprise has no available licenses for {% data variables.product.prodname_advanced_security %}.{% ifversion ghes %} - ![Screenshot of "Code security and analysis" features"](/assets/images/enterprise/3.4/repository/code-security-and-analysis-enable-ghas-3.4.png){% endif %} +{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} {% data reusables.repositories.navigate-to-code-security-and-analysis %} +1. 在“配置安全性和分析功能”下,检查是否启用了依赖项关系图。 +1. 如果已启用依赖项关系图,请单击“{% data variables.product.prodname_GH_advanced_security %}”旁边的“启用”以启用 {% data variables.product.prodname_advanced_security %},其中包含了依赖项审查。 如果企业没有可用的 {% data variables.product.prodname_advanced_security %} 许可证,“启用”按钮会禁用。{% ifversion ghes %} ![“代码安全性和分析”功能的屏幕截图](/assets/images/enterprise/3.4/repository/code-security-and-analysis-enable-ghas-3.4.png){% endif %} {% endif %} {% ifversion dependency-review-action-configuration %} -## About configuring the {% data variables.product.prodname_dependency_review_action %} +## 关于配置 {% data variables.product.prodname_dependency_review_action %} {% data reusables.dependency-review.dependency-review-action-overview %} -The following configuration options are available. +可用配置选项如下。 -| Option | Required | Usage | +| 选项 | 必选 | 使用情况 | |------------------|-------------------------------|--------| -| `fail-on-severity` | Optional | Defines the threshold for level of severity (`low`, `moderate`, `high`, `critical`).
The action will fail on any pull requests that introduce vulnerabilities of the specified severity level or higher. | -{%- ifversion dependency-review-action-licenses %} -| `allow-licenses` | Optional | Contains a list of allowed licenses. You can find the possible values for this parameter in the [Licenses](/rest/licenses) page of the API documentation.
The action will fail on pull requests that introduce dependencies with licenses that do not match the list.|{% endif %} -{%- ifversion dependency-review-action-licenses %} -| `deny-licenses` | Optional | Contains a list of prohibited licenses. You can find the possible values for this parameter in the [Licenses](/rest/licenses) page of the API documentation.
The action will fail on pull requests that introduce dependencies with licenses that match the list.|{% endif %}{% ifversion dependency-review-action-fail-on-scopes %} -| `fail-on-scopes` | Optional | Contains a list of strings representing the build environments you want to support (`development`, `runtime`, `unknown`).
The action will fail on pull requests that introduce vulnerabilites in the scopes that match the list.|{% endif %} -| `allow-ghsas` | Optional | Contains a list of {% data variables.product.prodname_advisory_database %} IDs that can be skipped during detection. You can find the possible values for this parameter in the [{% data variables.product.prodname_advisory_database %}](https://github.com/advisories). | -| `config-file` | Optional | Specifies a path to a configuration file. The configuration file can be local to the repository or a file located in an external repository.| -| `external-repo-token` | Optional | Specifies a token for fetching the configuration file, if the file resides in a private external repository. The token must have read access to the repository.| +| `fail-on-severity` | 可选 | 定义严重性级别(`low`、`moderate`、`high`、`critical`)的阈值。
对于引入指定严重性级别或更高级别的漏洞的任何拉取请求,该操作都将失败。 | +{%- ifversion dependency-review-action-licenses %} | `allow-licenses` | 可选 | 包含允许的许可证列表。 可以在 API 文档的[许可证](/rest/licenses)页中找到此参数可能的值。
如果拉取请求引入许可证与列表不匹配的依赖项,该操作将失败。|{% endif %} {%- ifversion dependency-review-action-licenses %} | `deny-licenses` | 可选 | 包含禁止的许可证列表。 可以在 API 文档的[许可证](/rest/licenses)页中找到此参数可能的值。
如果拉取请求引入了具有与列表匹配的许可证的依赖项,该操作将失败。|{% endif %}{% ifversion dependency-review-action-fail-on-scopes %} | `fail-on-scopes` | 可选 | 包含表示要支持的生成环境的字符串列表(`development`、`runtime`、`unknown`)。
对于在与列表匹配的范围内引入漏洞的拉取请求,该操作将失败。|{% endif %} | `allow-ghsas` | 可选 | 包含检测过程中可以跳过的 {% data variables.product.prodname_advisory_database %} ID 列表。 可以在 [{% data variables.product.prodname_advisory_database %}](https://github.com/advisories) 中找到此参数的可能值。 | | `config-file` | 可选 | 指定配置文件的路径。 配置文件可以是存储库的本地文件,也可以是位于外部存储库的文件。| | `external-repo-token` | 可选 | 如果文件驻留在专用外部存储库中,则指定用于提取配置文件的令牌。 令牌必须具有该存储库的读取权限。| -{% ifversion dependency-review-action-licenses %} -{% tip %} +{% ifversion dependency-review-action-licenses %} {% tip %} -**Tip:** The `allow-licenses` and `deny-licenses` options are mutually exclusive. +提示:`allow-licenses` 和 `deny-licenses` 选项互斥。 -{% endtip %} -{% endif %} +{% endtip %} {% endif %} -## Configuring the {% data variables.product.prodname_dependency_review_action %} +## 配置 {% data variables.product.prodname_dependency_review_action %} -There are two methods of configuring the {% data variables.product.prodname_dependency_review_action %}: -- Inlining the configuration options in your workflow file. -- Referencing a configuration file in your workflow file. +可以通过两种方法配置 {% data variables.product.prodname_dependency_review_action %}: +- 在工作流文件中内联配置选项。 +- 在工作流文件中引用配置文件。 -Notice that all of the examples use a short version number for the action (`v3`) instead of a semver release number (for example, `v3.0.8`). This ensures that you use the most recent minor version of the action. -### Using inline configuration to set up the {% data variables.product.prodname_dependency_review_action %} +请注意,所有示例使用操作 (`v3`) 的短版本号,而不是 semver 版本号(例如,`v3.0.8`)。 这可确保使用操作的最新次要版本。 +### 使用内联配置设置 {% data variables.product.prodname_dependency_review_action %} -1. Add a new YAML workflow to your `.github/workflows` folder. +1. 将新的 YAML 工作流添加到 `.github/workflows` 文件夹。 - {% ifversion ghes %}For `runs-on`, the default label is `self-hosted`. You can replace the default label with the label of any of your runners.{% endif %} + {% ifversion ghes %}对于 `runs-on`,默认标签为 `self-hosted`。 可以将默认标签替换为任何运行器的标签。{% endif %} ```yaml{:copy} name: 'Dependency Review' on: [pull_request] @@ -106,9 +97,9 @@ Notice that all of the examples use a short version number for the action (`v3`) - name: Dependency Review uses: actions/dependency-review-action@v3 ``` -1. Specify your settings. +1. 指定您的设置。 - This {% data variables.product.prodname_dependency_review_action %} example file illustrates how you can use the available configuration options. + 此 {% data variables.product.prodname_dependency_review_action %} 示例文件说明了如何使用可用的配置选项。 ```yaml{:copy} name: 'Dependency Review' on: [pull_request] @@ -146,11 +137,11 @@ Notice that all of the examples use a short version number for the action (`v3`) fail-on-scopes: development, runtime {% endif %} ``` -### Using a configuration file to set up {% data variables.product.prodname_dependency_review_action %} +### 使用配置文件设置 {% data variables.product.prodname_dependency_review_action %} -1. Add a new YAML workflow to your `.github/workflows` folder and use `config-file` to specify that you are using a configuration file. +1. 将新的 YAML 工作流添加到 `.github/workflows` 文件夹,并使用 `config-file` 指定正在使用配置文件。 - {% ifversion ghes %}For `runs-on`, the default label is `self-hosted`. You can replace the default label with the label of any of your runners.{% endif %} + {% ifversion ghes %}对于 `runs-on`,默认标签为 `self-hosted`。 可以将默认标签替换为任何运行器的标签。{% endif %} ```yaml{:copy} name: 'Dependency Review' on: [pull_request] @@ -178,9 +169,9 @@ Notice that all of the examples use a short version number for the action (`v3`) # Possible values: Any GitHub token with read access to the private external repository. external-repo-token: 'ghp_123456789abcde' ``` -1. Create the configuration file in the path you have specified. +1. 在指定路径中创建配置文件。 - This YAML example file illustrates how you can use the available configuration options. + 此 YAML 示例文件说明了如何使用可用的配置选项。 ```yaml{:copy} # Possible values: "critical", "high", "moderate", "low" fail-on-severity: critical @@ -211,5 +202,5 @@ Notice that all of the examples use a short version number for the action (`v3`) - runtime {% endif %} ``` -For further details about the configuration options, see [`dependency-review-action`](https://github.com/actions/dependency-review-action#readme). +有关配置选项的更多详细信息,请参阅 [`dependency-review-action`](https://github.com/actions/dependency-review-action#readme)。 {% endif %} diff --git a/translations/zh-CN/content/codespaces/codespaces-reference/disaster-recovery-for-github-codespaces.md b/translations/zh-CN/content/codespaces/codespaces-reference/disaster-recovery-for-github-codespaces.md index 0f6bc73866..3bdb5f59a8 100644 --- a/translations/zh-CN/content/codespaces/codespaces-reference/disaster-recovery-for-github-codespaces.md +++ b/translations/zh-CN/content/codespaces/codespaces-reference/disaster-recovery-for-github-codespaces.md @@ -1,6 +1,6 @@ --- -title: Disaster recovery for GitHub Codespaces -intro: 'This article describes guidance for a disaster recovery scenario, when a whole region experiences an outage due to major natural disaster or widespread service interruption.' +title: GitHub Codespaces 的灾难恢复 +intro: 本文描述了当整个地区因重大自然灾害或大范围服务中断而中断时,灾难恢复情景的指导。 versions: fpt: '*' ghec: '*' @@ -9,44 +9,49 @@ topics: shortTitle: Disaster recovery redirect_from: - /codespaces/codespaces-reference/disaster-recovery-for-codespaces +ms.openlocfilehash: 9b892d6a24332e01174c819e2e88a91d1cdf9d65 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158811' --- +我们努力确保你始终能够使用 {% data variables.product.prodname_github_codespaces %}。 但是,超出我们控制范围的力量有时会以导致计划外服务中断的方式影响服务。 -We work hard to make sure that {% data variables.product.prodname_github_codespaces %} is always available to you. However, forces beyond our control sometimes impact the service in ways that can cause unplanned service disruptions. +虽然灾难恢复情况很少发生,但我们建议您为整个区域出现中断的可能性做好准备。 如果整个区域遇到服务中断,则数据的本地冗余副本将暂时不可用。 -Although disaster recovery scenarios are rare occurrences, we recommend that you prepare for the possibility that there is an outage of an entire region. If an entire region experiences a service disruption, the locally redundant copies of your data would be temporarily unavailable. - -The following guidance provides options on how to handle service disruption to the entire region where your codespace is deployed. +以下指南提供了如何处理部署代码空间的整个区域的服务中断的选项。 {% note %} -**Note:** You can reduce the potential impact of service-wide outages by pushing to remote repositories frequently. +注意:可以通过频繁推送到远程存储库来减少服务中断的潜在影响。 {% endnote %} -## Option 1: Create a new codespace in another region +## 选项 1:在另一个区域中创建新的代码空间 -In the case of a regional outage, we suggest you recreate your codespace in an unaffected region to continue working. This new codespace will have all of the changes as of your last push to {% data variables.product.prodname_dotcom %}. For information on manually setting another region, see "[Setting your default region for {% data variables.product.prodname_github_codespaces %}](/codespaces/customizing-your-codespace/setting-your-default-region-for-github-codespaces)." +如果发生区域性断电,我们建议您在未受影响的区域中重新创建代码空间以继续工作。 此新代码将包含您上次推送到 {% data variables.product.prodname_dotcom %} 后的所有更改。 有关手动设置另一个区域的信息,请参阅“[为 {% data variables.product.prodname_github_codespaces %} 设置默认区域](/codespaces/customizing-your-codespace/setting-your-default-region-for-github-codespaces)”。 -You can optimize recovery time by configuring a `devcontainer.json` in the project's repository, which allows you to define the tools, runtimes, frameworks, editor settings, extensions, and other configuration necessary to restore the development environment automatically. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)." +你可以通过在项目存储库中配置 `devcontainer.json` 来优化恢复时间,这样可定义工具、运行时间、框架、编辑器设置、扩展以及其他自动恢复开发环境所需的配置。 有关详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)”。 -## Option 2: Wait for recovery +## 选项 2:等待恢复 -In this case, no action on your part is required. Know that we are working diligently to restore service availability. +在此情况下,不需要采取任何操作。 但要知道,我们正在努力还原服务的可用性。 -You can check the current service status on the [Status Dashboard](https://www.githubstatus.com/). +你可以在[状态仪表板](https://www.githubstatus.com/)上查看当前服务状态。 -## Option 3: Clone the repository locally or edit in the browser +## 选项 3:本地克隆存储库或在浏览器中编辑 -While {% data variables.product.prodname_github_codespaces %} provides the benefit of a pre-configured developer environmnent, your source code should always be accessible through the repository hosted on {% data variables.product.prodname_dotcom_the_website %}. In the event of a {% data variables.product.prodname_github_codespaces %} outage, you can still clone the repository locally or edit files in the {% data variables.product.company_short %} browser editor. For more information, see "[Editing files](/repositories/working-with-files/managing-files/editing-files)." +虽然 {% data variables.product.prodname_github_codespaces %} 具有预配置的开发者环境的优点,但源代码应该始终可以通过 {% data variables.product.prodname_dotcom_the_website %} 托管的存储库访问。 如果发生 {% data variables.product.prodname_github_codespaces %} 中断,仍然可以本地克隆存储库或在 {% data variables.product.company_short %} 浏览器编辑器中编辑文件。 有关详细信息,请参阅“[编辑文件](/repositories/working-with-files/managing-files/editing-files)”。 -While this option does not configure a development environment for you, it will allow you to make changes to your source code as needed while you wait for the service disruption to resolve. +虽然此选项没有为您配置开发环境, 但它允许您在等待服务中断解决时根据需要更改源代码。 -## Option 4: Use the Dev Containers extension and Docker for a local containerized environment +## 选项 4:对本地容器化环境使用开发容器扩展和 Docker -If your repository has a `devcontainer.json`, consider using the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in {% data variables.product.prodname_vscode %} to build and attach to a local development container for your repository. The setup time for this option will vary depending on your local specifications and the complexity of your dev container setup. For more information, see "[Developing inside a container](https://code.visualstudio.com/docs/remote/containers#_quick-start-open-a-git-repository-or-github-pr-in-an-isolated-container-volume)" in the {% data variables.product.prodname_vscode_shortname %} documentation. +如果存储库具有 `devcontainer.json`,请考虑在 {% data variables.product.prodname_vscode %} 中使用[开发容器扩展](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)构建并连接到存储库的本地开发容器。 此选项的设置时间将因您本地规格和开发容器设置的复杂性而异。 有关详细信息,请参阅 {% data variables.product.prodname_vscode_shortname %} 文档中的“[在容器中开发](https://code.visualstudio.com/docs/remote/containers#_quick-start-open-a-git-repository-or-github-pr-in-an-isolated-container-volume)”。 {% note %} -**Note:** Be sure your local setup meets the [minimum requirements](https://code.visualstudio.com/docs/remote/containers#_system-requirements) before attempting this option. +注意:在尝试使用此选项之前,请确保本地设置满足[最低要求](https://code.visualstudio.com/docs/remote/containers#_system-requirements)。 {% endnote %} diff --git a/translations/zh-CN/content/codespaces/codespaces-reference/index.md b/translations/zh-CN/content/codespaces/codespaces-reference/index.md index aadd3a3e94..e9eac6de09 100644 --- a/translations/zh-CN/content/codespaces/codespaces-reference/index.md +++ b/translations/zh-CN/content/codespaces/codespaces-reference/index.md @@ -10,6 +10,7 @@ children: - /using-the-github-codespaces-plugin-for-jetbrains - /using-the-vs-code-command-palette-in-codespaces - /security-in-github-codespaces + - /performing-a-full-rebuild-of-a-container - /disaster-recovery-for-github-codespaces ms.openlocfilehash: 87692cd862e791f3e6ffa2be2b07f34c6158e617 ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 diff --git a/translations/zh-CN/content/codespaces/codespaces-reference/using-github-copilot-in-github-codespaces.md b/translations/zh-CN/content/codespaces/codespaces-reference/using-github-copilot-in-github-codespaces.md index 48607d15d9..8ef01c5994 100644 --- a/translations/zh-CN/content/codespaces/codespaces-reference/using-github-copilot-in-github-codespaces.md +++ b/translations/zh-CN/content/codespaces/codespaces-reference/using-github-copilot-in-github-codespaces.md @@ -1,6 +1,6 @@ --- -title: Using GitHub Copilot in GitHub Codespaces -intro: 'You can use {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_github_codespaces %} by adding the extension.' +title: 在 GitHub Codespaces 中使用 GitHub Copilot +intro: '可以通过添加扩展在 {% data variables.product.prodname_github_codespaces %} 中使用 {% data variables.product.prodname_copilot %}。' versions: fpt: '*' ghec: '*' @@ -13,8 +13,13 @@ shortTitle: Copilot in Codespaces redirect_from: - /codespaces/codespaces-reference/using-copilot-in-codespaces - /codespaces/codespaces-reference/using-github-copilot-in-codespaces +ms.openlocfilehash: 6615df6930fa8f27dd8f50c4588d8182b8602549 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158723' --- - {% jetbrains %} {% data reusables.codespaces.codespaces-jetbrains-beta-note %} @@ -23,7 +28,7 @@ redirect_from: {% webui %} -## Using {% data variables.product.prodname_copilot %} in the {% data variables.product.prodname_vscode_shortname %} web client +## 在 {% data variables.product.prodname_vscode_shortname %} Web 客户端中使用 {% data variables.product.prodname_copilot %} {% data reusables.codespaces.copilot-in-vscode %} @@ -31,7 +36,7 @@ redirect_from: {% vscode %} -## Using {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vscode %} +## 在 {% data variables.product.prodname_vscode %} 中使用 {% data variables.product.prodname_copilot %} {% data reusables.codespaces.copilot-in-vscode %} @@ -39,57 +44,57 @@ redirect_from: {% jetbrains %} -## Installing {% data variables.product.prodname_copilot %} in your JetBrains IDE +## 在 JetBrains IDE 中安装 {% data variables.product.prodname_copilot %} -[{% data variables.product.prodname_copilot %}](https://copilot.github.com/), an AI pair programmer, can be used in any codespace. For more information, see "[About GitHub Copilot](/copilot/overview-of-github-copilot/about-github-copilot)." +[{% data variables.product.prodname_copilot %}](https://copilot.github.com/) 是 AI 结对程序员,可用于任何 codespace。 有关详细信息,请参阅“[关于 GitHub Copilot](/copilot/overview-of-github-copilot/about-github-copilot)”。 -To use {% data variables.product.prodname_copilot %} in a codespace in your JetBrains IDE, install the [{% data variables.product.prodname_copilot %} plugin](https://plugins.jetbrains.com/plugin/17718-github-copilot) from within your codespace. +若要在 JetBrains IDE 的 codespace 中使用 {% data variables.product.prodname_copilot %},请在 codespace 中安装 [{% data variables.product.prodname_copilot %} 插件](https://plugins.jetbrains.com/plugin/17718-github-copilot)。 {% note %} -**Note**: You must install the {% data variables.product.prodname_copilot %} plugin each time you create a new codespace. +注意:每次创建新 codespace 时,都必须安装 {% data variables.product.prodname_copilot %} 插件。 {% endnote %} -1. In the JetBrains client application, open the Settings (Windows/Linux) or Preferences (Mac) dialog box: +1. 在 JetBrains 客户端应用程序中,打开“设置”(Windows/Linux) 或“首选项”(Mac) 对话框: - - **Windows/Linux**: Click **File** and then **Settings** (or press Ctrl+Alt+S) - - **Mac**: Click **JetBrains Client** in the MacOS menu bar, then click **Preferences** (or press command+,) + - **Windows/Linux**:单击“文件”,然后单击“设置”(或按Ctrl+Alt+S) + - **Mac**:在 MacOS 菜单栏中单击“JetBrains 客户端”“首选项”(或按command+,) -1. In the left-side menu of the Settings/Preferences dialog box, click **Plugins On Host**. Then click the **Marketplace** tab. +1. 在“设置/首选项”对话框的左侧菜单中,单击“主机上的插件”。 然后单击“市场”选项卡。 - ![Screenshot of the Marketplace tab for 'Plugins On Host'](/assets/images/help/codespaces/jetbrains-preferences-plugins.png) + ![“主机上的插件”的“市场”选项卡的屏幕截图](/assets/images/help/codespaces/jetbrains-preferences-plugins.png) -1. In the search box, type "copilot" then click the **Install** button for the {% data variables.product.prodname_copilot %} plugin. +1. 在搜索框中,键入“copilot”,然后单击 {% data variables.product.prodname_copilot %} 插件的“安装”按钮。 - ![Screenshot of the {% data variables.product.prodname_copilot %} plugin](/assets/images/help/codespaces/jetbrains-copilot-plugin.png) + ![{% data variables.product.prodname_copilot %} 插件的屏幕截图](/assets/images/help/codespaces/jetbrains-copilot-plugin.png) -1. Click **Accept** on the "Third-Party Plugins Privacy Note" dialog box. -1. Click **Restart IDE**. +1. 在“第三方插件隐私说明”对话框中单击“接受”。 +1. 单击“重启 IDE”。 - ![Screenshot of the {% data variables.product.prodname_copilot %} plugin](/assets/images/help/codespaces/jetbrains-copilot-restart.png) + ![{% data variables.product.prodname_copilot %} 插件的屏幕截图](/assets/images/help/codespaces/jetbrains-copilot-restart.png) -1. Click **Restart** when prompted to confirm that you want to restart the backend IDE that's running remotely. The JetBrains client application will close when you do this. -1. Open the codespace again from the JetBrains Gateway application. For more information, see "[Using {% data variables.product.prodname_github_codespaces %} in your JetBrains IDE](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide#opening-a-codespace-in-your-jetbrains-ide)." -1. After your JetBrains IDE has restarted, click the **Tools** menu. Click **{% data variables.product.prodname_copilot %}**, then click **Login to {% data variables.product.prodname_dotcom %}**. +1. 当提示确认是否要重启远程运行的后端 IDE 时,单击“重启”。 单击重启后,JetBrains 客户端应用程序将关闭。 +1. 再次从 JetBrains 网关应用程序打开 codespace。 有关详细信息,请参阅“[在 JetBrains IDE 中使用 {% data variables.product.prodname_github_codespaces %}](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide#opening-a-codespace-in-your-jetbrains-ide)”。 +1. JetBrains IDE 重启后,单击“工具”菜单。 单击“{% data variables.product.prodname_copilot %}”,然后单击“登录到 {% data variables.product.prodname_dotcom %}”。 - ![Screenshot of the JetBrains Tools menu](/assets/images/help/codespaces/jetbrains-tools-menu.png) + ![JetBrains 工具菜单的屏幕截图](/assets/images/help/codespaces/jetbrains-tools-menu.png) -1. In the "Sign in to {% data variables.product.prodname_dotcom %}" dialog box, to copy the device code and open the device activation window, click **Copy and Open**. +1. 在“登录到 {% data variables.product.prodname_dotcom %}”对话框中,若要复制设备代码并打开设备激活窗口,请单击“复制并打开”。 - ![Screenshot of the device code copy and open](/assets/images/help/copilot/device-code-copy-and-open.png) + ![设备代码复制和打开的屏幕截图](/assets/images/help/copilot/device-code-copy-and-open.png) -1. A device activation window will open in your browser. Paste the device code, then click **Continue**. +1. 设备激活窗口将在浏览器中打开。 粘贴设备代码,然后单击“继续”。 - - To paste the code in Windows or Linux, press Ctrl+v. - - To paste the code in macOS, press command+v. -1. {% data variables.product.prodname_dotcom %} will request the necessary permissions for {% data variables.product.prodname_copilot %}. To approve these permissions, click **Authorize {% data variables.product.prodname_copilot %} Plugin**. -1. After the permissions have been approved, your JetBrains IDE will show a confirmation. To begin using {% data variables.product.prodname_copilot %}, click **OK**. + - 若要在 Windows 或 Linux 中粘贴代码,请按 Ctrl+v。 + - 若要在 macOS 中粘贴代码,请按 command+v。 +1. {% data variables.product.prodname_dotcom %} 将请求 {% data variables.product.prodname_copilot %} 所需的权限。 若要批准这些权限,请单击“授权 {% data variables.product.prodname_copilot %} 插件”。 +1. 权限获得批准后,JetBrains IDE 将显示确认。 要开始使用 {% data variables.product.prodname_copilot %},请单击“确定”。 - ![Screenshot of the JetBrains IDE permissions confirmation](/assets/images/help/copilot/jetbrains-ide-confirmation.png) + ![JetBrains IDE 权限确认的屏幕截图](/assets/images/help/copilot/jetbrains-ide-confirmation.png) -## Further reading +## 延伸阅读 -- "[Getting started with GitHub Copilot in a JetBrains IDE](/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-a-jetbrains-ide)" +- [在 JetBrains IDE 中开始使用 GitHub Copilot](/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-a-jetbrains-ide) -{% endjetbrains %} \ No newline at end of file +{% endjetbrains %} diff --git a/translations/zh-CN/content/codespaces/codespaces-reference/using-the-github-codespaces-plugin-for-jetbrains.md b/translations/zh-CN/content/codespaces/codespaces-reference/using-the-github-codespaces-plugin-for-jetbrains.md new file mode 100644 index 0000000000..df6c80b6e3 --- /dev/null +++ b/translations/zh-CN/content/codespaces/codespaces-reference/using-the-github-codespaces-plugin-for-jetbrains.md @@ -0,0 +1,72 @@ +--- +title: 使用适用于 JetBrains 的 GitHub Codespaces 插件 +shortTitle: Plugin for JetBrains +intro: '可以使用 JetBrains 客户端应用程序的 {% data variables.product.prodname_github_codespaces %} 插件来了解 codespace 或在完成工作后停止 codespace。' +versions: + fpt: '*' + ghec: '*' +type: reference +topics: + - Codespaces +ms.openlocfilehash: 8ffd48856a2653f3db3c871122d3acd23c246d7a +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159444' +--- +{% data reusables.codespaces.codespaces-jetbrains-beta-note %} + +## 关于 {% data variables.product.prodname_github_codespaces %} 插件 + +从 JetBrains 网关应用程序连接到 codespace 时,将启动 JetBrains 客户端应用程序。 它允许你将 {% data variables.product.prodname_github_codespaces %} 与你最喜爱的 JetBrains IDE 一起使用。 有关详细信息,请参阅“[在 JetBrains IDE 中使用 {% data variables.product.prodname_github_codespaces %}](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide)”。 + +从 JetBrains 网关连接到 codespace 时,{% data variables.product.prodname_github_codespaces %} 插件已安装在 JetBrains 客户端中。 插件将 {% data variables.product.prodname_github_codespaces %} 工具窗口添加到用户界面。 + +单击 JetBrains 客户端应用程序窗口左下角的“{% data variables.product.prodname_github_codespaces %}”以打开 {% data variables.product.prodname_github_codespaces %} 工具窗口。 + +![{% data variables.product.prodname_github_codespaces %} 工具窗口的屏幕截图](/assets/images/help/codespaces/jetbrains-codespaces-tool-window.png) + +## 使用 {% data variables.product.prodname_github_codespaces %} 工具窗口 + +{% data variables.product.prodname_github_codespaces %} 工具窗口显示: +* 从中创建此 codespace 的存储库。 +* codespace 的显示名称。 +* 当前分支。 +* 计算机规格。 +* 此 codespace 在自动停止之前可以保持空闲的时间。 +* codespace 的使用期限。 +* 停止的 codespace 在自动删除之前将保留的时间段。 + +{% data variables.product.prodname_github_codespaces %} 工具窗口顶部的图标提供以下功能。 + +* **刷新活动 codespace** + + ![“刷新”按钮的屏幕截图](/assets/images/help/codespaces/jetbrains-plugin-icon-refresh-BAK.png) + + 刷新 {% data variables.product.prodname_github_codespaces %} 工具窗口中的详细信息。 例如,如果使用了 {% data variables.product.prodname_cli %} 更改显示名称,则可以单击此按钮以显示新名称。 + +* **断开连接并停止** + + ![“停止”按钮的屏幕截图](/assets/images/help/codespaces/jetbrains-plugin-icon-stop.png) + + 停止 codespace,停止远程计算机上的后端 IDE,然后关闭本地 JetBrains 客户端。 + +* **从 Web 管理 codespace** + + ![“列表”按钮的屏幕截图](/assets/images/help/codespaces/jetbrains-plugin-icon-index.png) + + 在 https://github.com/codespaces 打开 codespace 列表。 + +* **查看 codespace 创建日志** + + ![“日志”按钮的屏幕截图](/assets/images/help/codespaces/jetbrains-plugin-icon-log.png) + + 在编辑器窗口中打开 codespace 创建日志。 有关详细信息,请参阅“[{% data variables.product.prodname_github_codespaces %} 日志](/codespaces/troubleshooting/github-codespaces-logs)”。 + +* **重新生成开发容器** + + ![“重新生成”按钮的屏幕截图](/assets/images/help/codespaces/jetbrains-plugin-icon-rebuild.png) + + 重新生成 codespace 以应用对开发容器配置所做的更改。 JetBrains 客户端将关闭,必须重新打开 codespace。 有关详细信息,请参阅“[codespace 生命周期](/codespaces/developing-in-codespaces/the-codespace-lifecycle#rebuilding-a-codespace)”。 + diff --git a/translations/zh-CN/content/codespaces/codespaces-reference/using-the-vs-code-command-palette-in-codespaces.md b/translations/zh-CN/content/codespaces/codespaces-reference/using-the-vs-code-command-palette-in-codespaces.md index b46863bb7f..1ae7d23c67 100644 --- a/translations/zh-CN/content/codespaces/codespaces-reference/using-the-vs-code-command-palette-in-codespaces.md +++ b/translations/zh-CN/content/codespaces/codespaces-reference/using-the-vs-code-command-palette-in-codespaces.md @@ -58,6 +58,8 @@ To rebuild your container, [access the {% data variables.product.prodname_vscode ![Command to rebuild a codespace](/assets/images/help/codespaces/codespaces-rebuild.png) +{% data reusables.codespaces.full-rebuild-tip %} + ### Codespaces logs You can use the {% data variables.product.prodname_vscode_command_palette_shortname %} to access the codespace creation logs, or you can use it export all logs. diff --git a/translations/zh-CN/content/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace.md b/translations/zh-CN/content/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace.md index 5ee22758aa..5673160504 100644 --- a/translations/zh-CN/content/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace.md +++ b/translations/zh-CN/content/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace.md @@ -1,7 +1,7 @@ --- -title: Changing the machine type for your codespace +title: 更改代码空间的计算机类型 shortTitle: Change the machine type -intro: 'You can change the type of machine that''s running your codespace, so that you''re using resources appropriate for the work you''re doing.' +intro: 可更改运行 codespace 的计算机类型,以便使用适合你正在执行的工作的资源。 versions: fpt: '*' ghec: '*' @@ -10,21 +10,26 @@ redirect_from: topics: - Codespaces type: how_to +ms.openlocfilehash: b8614e9389aa617b3bfcfa3444f5a60aa7dd3c2e +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159083' --- +## 关于机器类型 -## About machine types +{% data reusables.codespaces.codespaces-machine-types %} 可以在创建 codespace 时或创建 codespace 后的任何时间选择备用计算机类型。 -{% data reusables.codespaces.codespaces-machine-types %} You can choose an alternative machine type either when you create a codespace or at any time after you've created a codespace. +有关在创建 codespace 时选择计算机类型的信息,请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)”。 -For information on choosing a machine type when you create a codespace, see "[Creating a codespace for a repository](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)." +{% data reusables.codespaces.machine-types-for-unpublished-codespaces %} 有关详细信息,请参阅“[从模板创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template)”。 -{% data reusables.codespaces.machine-types-for-unpublished-codespaces %} For more information, see "[Creating a codespace from a template](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template)." - -## Changing the machine type +## 更改计算机类型 {% note %} -**Note**: {% data reusables.codespaces.codespaces-machine-type-availability %} +注意:{% data reusables.codespaces.codespaces-machine-type-availability %} {% endnote %} @@ -32,18 +37,18 @@ For information on choosing a machine type when you create a codespace, see "[Cr {% data reusables.codespaces.your-codespaces-procedure-step %} - The current machine type for each of your codespaces is displayed. + 将显示每个代码空间的当前计算机类型。 - !['Your codespaces' list](/assets/images/help/codespaces/your-codespaces-list.png) + ![“您的代码空间”列表](/assets/images/help/codespaces/your-codespaces-list.png) {% data reusables.codespaces.ellipsis-settings %} -1. Click **Change machine type**. +1. 单击“更改计算机类型”。 - !['Change machine type' menu option](/assets/images/help/codespaces/change-machine-type-menu-option.png) -1. If multiple machine types are available for your codespace, choose the type of machine you want to use. + ![“更改机器类型”菜单选项](/assets/images/help/codespaces/change-machine-type-menu-option.png) +1. 如果有多个计算机类型可用于代码空间,请选择要使用的计算机类型。 - ![Dialog box showing available machine types to choose](/assets/images/help/codespaces/change-machine-type-choice.png) -1. Click **Update codespace**. + ![显示可供选择的可用计算机类型的对话框](/assets/images/help/codespaces/change-machine-type-choice.png) +1. 单击“更新 codespace”。 {% endwebui %} @@ -55,39 +60,39 @@ For information on choosing a machine type when you create a codespace, see "[Cr {% cli %} -You can use the `gh codespace edit --machine MACHINE-TYPE-NAME` {% data variables.product.prodname_cli %} command to change the machine type of a codespace. To use this command, you'll first need to find out the available machine types for your codespace. +可使用 `gh codespace edit --machine MACHINE-TYPE-NAME` {% data variables.product.prodname_cli %} 命令更改 codespace 的计算机类型。 要使用此命令,首先需要了解可用于 codespace 的计算机类型。 -1. To view your list of codespaces, in a terminal, enter the following command. +1. 要查看 codespace 列表,请在终端中输入以下命令。 ``` gh codespace list ``` -1. Optionally, to find the current machine type for a codespace, enter the following command. +1. (可选)要查找 codespace 的当前计算机类型,请输入以下命令。 ``` gh api /user/codespaces/CODESPACE-NAME ``` - Replace `CODESPACE-NAME` with the permanent name of the codespace, for example `octocat-literate-space-parakeet-mld5`. The permanent names are listed under the **NAME** column in the list returned by `gh codespace list`. + 将 `CODESPACE-NAME` 替换为 codespace 的永久名称,如 `octocat-literate-space-parakeet-mld5`。 永久名称列在 返回的列表中的“名称”列下`gh codespace list`。 - If you're prompted to request the `codespace` scope, follow the instructions in the terminal. + 如果系统提示请求 `codespace` 范围,请按照终端中的说明进行操作。 - Details for the current machine are listed under the `machine` field. -1. To find the available machine types for a codespace, enter the following command. + 当前计算机的详细信息列在 `machine` 字段下。 +1. 要查找可用于 codespace 的计算机类型,请输入以下命令。 ``` gh api /user/codespaces/CODESPACE-NAME/machines ``` - Replace `CODESPACE-NAME` with the permanent name of the codespace, for example `octocat-literate-space-parakeet-mld5`. -1. To change the machine type for a codespace, enter the following command. + 将 `CODESPACE-NAME` 替换为 codespace 的永久名称,如 `octocat-literate-space-parakeet-mld5`。 +1. 要更改 codespace 的计算机类型,请输入以下命令。 ``` gh codespace edit --machine MACHINE-TYPE-NAME ``` - Replace `MACHINE-TYPE-NAME` with the name of an available machine type for your codespace, for example `standardLinux32gb`. -1. Using the arrow keys, navigate to the codespace you want to change, then press Enter. + 将 `MACHINE-TYPE-NAME` 替换为可用于 codespace 的计算机类型的名称,例如 `standardLinux32gb`。 +1. 使用箭头键导航到要更改的 codespace,然后按 Enter。 {% endcli %} @@ -95,9 +100,9 @@ You can use the `gh codespace edit --machine MACHINE-TYPE-NAME` {% data variable {% cli %} -## Further reading +## 延伸阅读 -- "[Codespaces machines](/rest/codespaces/machines)" in the REST API documentation -- [`gh codespace edit`](https://cli.github.com/manual/gh_codespace_edit) in the {% data variables.product.prodname_cli %} manual +- REST API 文档中的“[Codespaces 计算机](/rest/codespaces/machines)” +- {% data variables.product.prodname_cli %} 手册中的 [`gh codespace edit`](https://cli.github.com/manual/gh_codespace_edit) {% endcli %} diff --git a/translations/zh-CN/content/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces.md b/translations/zh-CN/content/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces.md index f0b5bc7897..ddb0571203 100644 --- a/translations/zh-CN/content/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces.md +++ b/translations/zh-CN/content/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces.md @@ -1,85 +1,89 @@ --- -title: Configuring automatic deletion of your codespaces +title: 配置 codespace 的自动删除 shortTitle: Configure automatic deletion -intro: 'Inactive codespaces are automatically deleted. You can choose how long your stopped codespaces are retained, up to a maximum of 30 days.' +intro: 处于非活动状态的 codespace 会自动删除。 你可以选择停止的 codespace 将保留多长时间,最长为 30 天。 versions: fpt: '*' ghec: '*' topics: - Codespaces type: how_to +ms.openlocfilehash: 5414d2223f490638f27475840a25883e9c353e77 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159488' --- +默认情况下,{% data variables.product.prodname_github_codespaces %} 在停止且保持 30 天的非活动状态后会自动删除。 -By default, {% data variables.product.prodname_github_codespaces %} are automatically deleted after they have been stopped and have remained inactive for 30 days. - -However, because {% data variables.product.prodname_github_codespaces %} incurs storage charges, you may prefer to reduce the retention period by changing your default period in your personal settings for {% data variables.product.prodname_github_codespaces %}. For more information about storage charges, see "[About billing for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#codespaces-pricing)." +但是,由于 {% data variables.product.prodname_github_codespaces %} 会产生存储费用,因此,你可能希望通过在 {% data variables.product.prodname_github_codespaces %} 的个人设置中更改默认期限来减少保持期。 有关存储费用的详细信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#codespaces-pricing)”。 {% note %} -**Note**: Whether or not you have set a personal codespace retention period, it's a good idea to get into the habit of deleting codespaces that you no longer need. For more information, see "[Deleting a codespace](/codespaces/developing-in-codespaces/deleting-a-codespace)." +注意:无论你是否设置了个人 codespace 保持期,最好养成删除不再需要的 codespace 的习惯。 有关详细信息,请参阅“[删除 codespace](/codespaces/developing-in-codespaces/deleting-a-codespace)”。 {% endnote %} -Automatic deletion happens irrespective of whether a codespace contains unpushed changes. To prevent automatic deletion of a codespace, just open the codespace again. The retention period is reset every time you connect to a codespace, and the retention countdown restarts when the codespace is stopped. +无论 codespace 是否包含未推送的更改,自动删除都会进行。 若要防止 codespace 的自动删除,只需再次打开此 codespace 即可。 每次连接到 codespace 时保持期都会重置,并且当 codespace 停止时,保留倒计时将重新开始。 -If a repository belongs to an organization, the organization admin may have set a retention period for the whole organization. If this period is less than the default retention period in your personal settings then the organization retention period will apply to codespaces you create for this repository. For more information, see "[Restricting the retention period for codespaces](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces)." +如果存储库属于某一组织,此组织管理员可能已为整个组织设置了保持期。 如果此期限小于个人设置中的默认保持期,则组织保持期将应用于为此存储库创建的 codespace。 有关详细信息,请参阅“[限制 codespace 的保持期](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces)”。 -Each codespace has its own retention period. You may, therefore, have codespaces with different rentention periods. For example, if: -* You created a codespace, changed your default retention period, then created another codespace. -* You created a codespace using {% data variables.product.prodname_cli %} and specified a different retention period. -* You created a codespace from an organization-owned repository that has a retention period configured for the organization. +每个 codespace 都有自身的保持期。 因此,你可能拥有具有不同保持期的 codespace。 例如,如果: +* 你创建了一个 codespace,更改了你的默认保持期,然后创建了另一个 codespace。 +* 你使用 {% data variables.product.prodname_cli %} 创建了一个 codespace,并指定了一个不同的保持期。 +* 你从组织拥有的存储库创建了一个 codespace,该存储库拥有为组织配置的保持期。 {% note %} -**Note**: The retention period is specified in days. A day represents a 24-hour period, beginning at the time of day when you stop a codespace. +注意:保持期是按天指定的。 一天表示一个 24 小时的期限,从停止 codespace 那一天的那一刻起。 {% endnote %} {% webui %} -## Setting a default retention period for your codespaces +## 设置 codespace 的默认保持期 -{% data reusables.user-settings.access_settings %} -{% data reusables.user-settings.codespaces-tab %} -1. Under "Default retention period", enter the number of days for which you want your codespaces to be retained, by default, after they have been stopped. +{% data reusables.user-settings.access_settings %} {% data reusables.user-settings.codespaces-tab %} +1. 在“默认保持期”下,输入你希望 codespace 在停止后默认将保留的天数。 - ![Selecting your retention period](/assets/images/help/codespaces/setting-default-retention.png) + ![选择保持期](/assets/images/help/codespaces/setting-default-retention.png) - You can set your default retention period between `0` and `30` days. + 你可以在 `0` 到 `30` 天之间设置默认的保持期。 {% warning %} - **Warning**: Setting the period to `0` will result in your codespaces being immediately deleted when you stop them, or when they timeout due to inactivity. For more information, see "[Setting your timeout period for {% data variables.product.prodname_github_codespaces %}](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-github-codespaces)." + 警告:将期限设置为 `0` 将导致 codespace 在停止时或由于处于非活动状态而超时时被立即删除。 有关详细信息,请参阅“[设置 {% data variables.product.prodname_github_codespaces %} 的超时时间](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-github-codespaces)”。 {% endwarning %} -1. Click **Save**. +1. 单击“保存” 。 -When you create a codespace using {% data variables.product.prodname_cli %} you can override this default. If you create a codespace in an organization that specifies a shorter retention period, the organization-level value overrides your personal setting. +使用 {% data variables.product.prodname_cli %} 创建 codespace 时,可以重写此默认值。 如果在指定了更短保持期的组织中创建 codespace,则组织级别的值将重写你的个人设置。 -If you set a retention period of more than a day, you'll be sent an email notification one day prior to its deletion. +如果设置的保持期超过一天,你将在删除的前一天收到电子邮件通知。 -## Checking the remaining time until autodeletion +## 检查自动删除之前剩余的时间 -You can check whether a codespace is due to be automatically deleted soon. +可以查看 codespace 是否即将自动删除。 -When an inactive codespace is approaching the end of its retention period, this is indicated in your list of codespaces on {% data variables.product.prodname_dotcom %} at [https://github.com/codespaces](https://github.com/codespaces). +当处于非活动状态的 codespace 的保持期即将结束时,这将在 {% data variables.product.prodname_dotcom %} 上的 codespace 列表中指明:[https://github.com/codespaces](https://github.com/codespaces)。 -![The pre-deletion message in the codespaces list on {% data variables.product.prodname_dotcom %}](/assets/images/help/codespaces/retention-deletion-message.png) +![{% data variables.product.prodname_dotcom %} 上的 codespace 列表中的预删除消息](/assets/images/help/codespaces/retention-deletion-message.png) {% endwebui %} {% cli %} -## Setting a retention period for a codespace +## 设置 codespace 的保持期 -To set the codespace retention period when you create a codespace, use the `--retention-period` flag with the `codespace create` subcommand. Specify the period in days. The period must be between 0 and 30 days. +若要在创建 codespace 时设置 codespace 保持期,请将 `--retention-period` 标志与 `codespace create` 子命令一起使用。 按天数指定期限。 期限必须介于 0 到 30 天之间。 ```shell gh codespace create --retention-period DAYS ``` -If you don't specify a retention period when you create a codespace, then either your default retention period, or an organization retention period, will be used, depending on which is lower. For information about setting your default retention period, click the "Web browser" tab on this page. +如果在创建 codespace 时未指定保持期,则将使用默认保持期或组织保持期,具体视哪个保持期的期限较低。 有关设置默认保持期的信息,请单击此页面上的“Web 浏览器”选项卡。 {% data reusables.cli.cli-learn-more %} @@ -87,20 +91,20 @@ If you don't specify a retention period when you create a codespace, then either {% vscode %} -## Setting the retention period +## 指定保持期 -You can set your default retention period in your web browser, on {% data variables.product.prodname_dotcom_the_website %}. Alternatively, if you use {% data variables.product.prodname_cli %} to create a codespace you can set a retention period for that particular codespace. For more information, click the appropriate tab above. +可以通过 Web 浏览器在 {% data variables.product.prodname_dotcom_the_website %} 上设置默认保持期。 或者,如果使用 {% data variables.product.prodname_cli %} 创建 codespace,则可以为该特定 codespace 设置保持期。 有关详细信息,请单击上面相应的选项卡。 -## Checking whether codespaces will be autodeleted soon +## 检查 codespace 是否即将被自动删除 -You can check, in the {% data variables.product.prodname_vscode %} desktop application, whether a codespace is due to be automatically deleted soon. +可以在 {% data variables.product.prodname_vscode %} 桌面应用程序中检查 codespace 是否即将自动删除。 {% data reusables.codespaces.click-remote-explorer-icon-vscode %} -1. Choose **{% data variables.product.prodname_github_codespaces %}** from the dropdown menu at the top right of the Remote Explorer, if it is not already selected. -1. Under "GITHUB CODESPACES," position the mouse pointer over the codespace that you're interested in. A pop-up box is displayed showing you information about the codespace. +1. 从“远程资源管理器”右上角的下拉菜单中选择“{% data variables.product.prodname_github_codespaces %}”(如果尚未选择)。 +1. 在“GITHUB CODESPACES”下,将鼠标指针放置在你感兴趣的 codespace 上。 随即将显示一个弹出框,其中显示了有关 codespace 的信息。 - If the codespace is nearing the end of its retention period, a line is included telling you when the codespace will be deleted. + 如果 codespace 即将接近保持期的末尾,则会包含一行,此行将告知你 codespace 将何时被删除。 - ![Codespace information showing the time until deletion](/assets/images/help/codespaces/vscode-deleting-in-5-days.png) + ![显示了删除前剩余时间的 codespace 信息](/assets/images/help/codespaces/vscode-deleting-in-5-days.png) {% endvscode %} diff --git a/translations/zh-CN/content/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account.md b/translations/zh-CN/content/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account.md index ccd3cdb369..83a0b51b7d 100644 --- a/translations/zh-CN/content/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account.md +++ b/translations/zh-CN/content/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account.md @@ -1,7 +1,7 @@ --- -title: Personalizing GitHub Codespaces for your account +title: 个性化你帐户的 GitHub Codespaces shortTitle: Personalize your codespaces -intro: 'You can personalize {% data variables.product.prodname_github_codespaces %} by using a `dotfiles` repository on {% data variables.product.product_name %} or by using Settings Sync.' +intro: '你可以通过使用 {% data variables.product.product_name %} 上的 `dotfiles` 存储库或使用“设置同步”来个性化 {% data variables.product.prodname_github_codespaces %}。' redirect_from: - /github/developing-online-with-github-codespaces/personalizing-github-codespaces-for-your-account - /github/developing-online-with-codespaces/personalizing-codespaces-for-your-account @@ -15,91 +15,94 @@ topics: - Codespaces - Set up - Fundamentals +ms.openlocfilehash: 80b6cd1ee982150c1b3c0a66e1247f6098a97bcb +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159769' --- +## 关于个性化 {% data variables.product.prodname_codespaces %} +在使用任何开发环境时,根据您的喜好和工作流程自定义设置和工具是一个重要步骤。 {% data variables.product.prodname_github_codespaces %} 支持两种将 codespace 个性化的主要方法。 -## About personalizing {% data variables.product.prodname_codespaces %} +- [设置同步](#settings-sync) - 可以在桌面应用程序与 {% data variables.product.prodname_vscode_shortname %} Web 客户端之间同步 {% data variables.product.prodname_vscode %} 设置。 +- [Dotfiles](#dotfiles) - 可以使用 `dotfiles` 存储库指定脚本、shell 首选项和其他配置。 -When using any development environment, customizing the settings and tools to your preferences and workflows is an important step. {% data variables.product.prodname_github_codespaces %} allows for two main ways of personalizing your codespaces. +{% data variables.product.prodname_github_codespaces %} 个性化适用于你创建的任何代码空间。 -- [Settings Sync](#settings-sync) - You can synchronize your {% data variables.product.prodname_vscode %} settings between the desktop application and the {% data variables.product.prodname_vscode_shortname %} web client. -- [Dotfiles](#dotfiles) – You can use a `dotfiles` repository to specify scripts, shell preferences, and other configurations. +项目维护员还可以定义默认配置,将应用到任何人创建的仓库的每个代码空间。 有关详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)”。 -{% data variables.product.prodname_github_codespaces %} personalization applies to any codespace you create. +## 设置同步 -Project maintainers can also define a default configuration that applies to every codespace for a repository, created by anyone. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)." +设置同步可让你在机器和 {% data variables.product.prodname_vscode_shortname %} 实例中同步配置,如设置、键盘快捷方式、片段、扩展和 UI 状态。 -## Settings Sync +要启用设置同步,在 {% data variables.product.prodname_vscode %} 活动栏的左下角,选择 {% octicon "gear" aria-label="The gear icon" %} 并单击“打开设置同步...”。 在对话框中,选择要同步的设置。 -Settings Sync allows you to synchronize configurations such as settings, keyboard shortcuts, snippets, extensions, and UI state across machines and instances of {% data variables.product.prodname_vscode_shortname %}. +![在管理菜单中设置同步选项](/assets/images/help/codespaces/codespaces-manage-settings-sync.png) -To enable Settings Sync, in the bottom-left corner of {% data variables.product.prodname_vscode %}'s Activity Bar, select {% octicon "gear" aria-label="The gear icon" %} and click **Turn on Settings Sync…**. In the dialog box, select the settings you'd like to sync. - -![Setting Sync option in manage menu](/assets/images/help/codespaces/codespaces-manage-settings-sync.png) - -For more information, see the [Settings Sync guide](https://code.visualstudio.com/docs/editor/settings-sync) in the {% data variables.product.prodname_vscode_shortname %} documentation. +有关详细信息,请参阅 {% data variables.product.prodname_vscode_shortname %} 文档中的[设置同步指南](https://code.visualstudio.com/docs/editor/settings-sync)。 ## Dotfiles -Dotfiles are files and folders on Unix-like systems starting with `.` that control the configuration of applications and shells on your system. You can store and manage your dotfiles in a repository on {% data variables.product.prodname_dotcom %}. For advice and tutorials about what to include in your dotfiles repository, see [GitHub does dotfiles](https://dotfiles.github.io/). +Dotfiles 是类似 Unix 的系统上以 `.` 开头的文件和文件夹,用于控制系统上应用程序和 shell 的配置。 您可以在 {% data variables.product.prodname_dotcom %} 上的仓库中存储和管理 dotfiles。 有关 dotfiles 存储库中所含内容的建议和教程,请参阅 [GitHub 执行 dotfiles](https://dotfiles.github.io/)。 -Your dotfiles repository might include your shell aliases and preferences, any tools you want to install, or any other codespace personalization you want to make. +dotfiles 仓库可能包括 shell 别名和首选项、您想要安装的任何工具或您想要执行的任何其他代码个性化。 -You can configure {% data variables.product.prodname_github_codespaces %} to use dotfiles from any repository you own by selecting that repository in your [personal {% data variables.product.prodname_github_codespaces %} settings](https://github.com/settings/codespaces). +可以在[个人 {% data variables.product.prodname_github_codespaces %} 设置](https://github.com/settings/codespaces)中选择存储库,将 {% data variables.product.prodname_github_codespaces %} 配置为使用你拥有的任何存储库中的 dotfiles。 -When you create a new codespace, {% data variables.product.prodname_dotcom %} clones your selected dotfiles repository to the codespace environment, and looks for one of the following files to set up the environment. +创建新的 codespace 时,{% data variables.product.prodname_dotcom %} 会将所选点文件存储库克隆到 codespace 环境,并查找以下文件之一来设置环境。 -* _install.sh_ +* install.sh * _install_ -* _bootstrap.sh_ +* bootstrap.sh * _bootstrap_ -* _script/bootstrap_ +* script/bootstrap * _setup.sh_ -* _setup_ -* _script/setup_ +* setup +* script/setup -If none of these files are found, then any files or folders in your selected dotfiles repository starting with `.` are symlinked to the codespace's `~` or `$HOME` directory. +如果未找到这些文件,则所选 dotfiles 存储库中以 `.` 开头的文件或文件夹通过符号链接到代码空间的 `~` 或 `$HOME` 目录。 -Any changes to your selected dotfiles repository will apply only to each new codespace, and do not affect any existing codespace. +对所选 dotfiles 仓库所做的任何更改只会应用到每个新的代码空间,而不影响任何现有的代码空间。 {% note %} -**Note:** Currently, {% data variables.product.prodname_codespaces %} does not support personalizing the User-scoped settings for {% data variables.product.prodname_vscode_shortname %} with your `dotfiles` repository. You can set default Workspace and Remote [Codespaces] settings for a specific project in the project's repository. For more information, see "[Introduction to dev containers](/github/developing-online-with-codespaces/configuring-codespaces-for-your-project#creating-a-custom-dev-container-configuration)." +注意:目前,{% data variables.product.prodname_codespaces %} 不支持通过 `dotfiles` 存储库将 {% data variables.product.prodname_vscode_shortname %} 的用户范围的设置进行个性化。 可以为项目存储库中的特定项目设置默认“工作区”和“远程 [Codespaces]”设置。 有关详细信息,请参阅“[开发容器简介](/github/developing-online-with-codespaces/configuring-codespaces-for-your-project#creating-a-custom-dev-container-configuration)”。 {% endnote %} -### Enabling your dotfiles repository for {% data variables.product.prodname_codespaces %} +### 为 {% data variables.product.prodname_codespaces %} 启用 dotfiles 存储库 -You can use your selected dotfiles repository to personalize your {% data variables.product.prodname_github_codespaces %} environment. Once you choose your dotfiles repository, you can add your scripts, preferences, and configurations to it. You then need to enable your dotfiles from your personal {% data variables.product.prodname_github_codespaces %} settings page. +可以使用所选的 dotfiles 存储库来将 {% data variables.product.prodname_github_codespaces %} 环境个性化。 选择 dotfiles 存储库后,可以向其中添加脚本、首选项和配置。 然后,需要从个人 {% data variables.product.prodname_github_codespaces %} 设置页面启用 dotfiles。 {% warning %} -**Warning:** Dotfiles have the ability to run arbitrary scripts, which may contain unexpected or malicious code. Before installing a dotfiles repo, we recommend checking scripts to ensure they don't perform any unexpected actions. +警告:Dotfiles 能够运行任意脚本,这些脚本可能包含意外或恶意代码。 在安装 dotfiles 存储库之前,我们建议检查脚本以确保它们不会执行任何意外操作。 {% endwarning %} -{% data reusables.user-settings.access_settings %} -{% data reusables.user-settings.codespaces-tab %} -1. Under "Dotfiles", select **Automatically install dotfiles** so that {% data variables.product.prodname_github_codespaces %} automatically installs your dotfiles into every new codespace you create. - ![Installing dotfiles](/assets/images/help/codespaces/install-custom-dotfiles.png) -2. Choose the repository you want to install dotfiles from. - ![Selecting a dotfiles repo](/assets/images/help/codespaces/select-dotfiles-repo.png) +{% data reusables.user-settings.access_settings %} {% data reusables.user-settings.codespaces-tab %} +1. 在“Dotfiles”下,选择“自动安装 dotfiles”,以便 {% data variables.product.prodname_github_codespaces %} 自动将 dotfiles 安装到你创建的每个新 codespace 中。 + ![安装 dotfiles](/assets/images/help/codespaces/install-custom-dotfiles.png) +2. 选择要从中安装 dotfile 的存储库。 + ![选择 dotfiles 存储库](/assets/images/help/codespaces/select-dotfiles-repo.png) -You can add further script, preferences, configuration files to your dotfiles repository or edit existing files whenever you want. Changes to settings will only be picked up by new codespaces. +您可以随时将更多脚本、首选项、配置文件添加到 dotfiles 存储库或编辑现有文件。 对设置的更改将仅由新的代码空间选取。 -If your codespace fails to pick up configuration settings from dotfiles, see "[Troubleshooting dotfiles for {% data variables.product.prodname_github_codespaces %}](/codespaces/troubleshooting/troubleshooting-dotfiles-for-codespaces)." +如果 codespace 无法从 dotfiles 中选取配置设置,请参阅“[排查 {% data variables.product.prodname_github_codespaces %} 的 dotfiles 问题](/codespaces/troubleshooting/troubleshooting-dotfiles-for-codespaces)”。 -## Other available settings +## 其他可用设置 -You can also personalize {% data variables.product.prodname_github_codespaces %} using additional options in [your personal settings](https://github.com/settings/codespaces): +还可以使用[个人设置](https://github.com/settings/codespaces)中的其他选项对 {% data variables.product.prodname_github_codespaces %} 进行个性化设置: -- To enable GPG verification, see "[Managing GPG verification for {% data variables.product.prodname_github_codespaces %}](/codespaces/managing-your-codespaces/managing-gpg-verification-for-github-codespaces)." -- To set your editor, see "[Setting your default editor for {% data variables.product.prodname_github_codespaces %}](/codespaces/customizing-your-codespace/setting-your-default-editor-for-github-codespaces)." -- To set how long a codespace can remain unused before it is automatically stopped, see "[Setting your timeout period for {% data variables.product.prodname_github_codespaces %}](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-github-codespaces)." -- To set the period for which your unused codespaces are retained, see "[Configuring automatic deletion of your codespaces](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces)." -- To set your default region, see "[Setting your default region for {% data variables.product.prodname_github_codespaces %}](/codespaces/customizing-your-codespace/setting-your-default-region-for-github-codespaces)." +- 若要启用 GPG 验证,请参阅“[管理 {% data variables.product.prodname_github_codespaces %} 的 GPG 验证](/codespaces/managing-your-codespaces/managing-gpg-verification-for-github-codespaces)”。 +- 若要设置编辑器,请参阅“[为 {% data variables.product.prodname_github_codespaces %} 设置默认编辑器](/codespaces/customizing-your-codespace/setting-your-default-editor-for-github-codespaces)”。 +- 若要设置 codespace 在自动停止之前可能保持未使用状态的时间长度,请参阅“[设置 {% data variables.product.prodname_github_codespaces %} 超时期限](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-github-codespaces)”。 +- 若要设置保留未使用 codespace 的时间段,请参阅“[配置 codespace 的自动删除](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces)”。 +- 若要设置默认区域,请参阅“[为 {% data variables.product.prodname_github_codespaces %} 设置默认区域](/codespaces/customizing-your-codespace/setting-your-default-region-for-github-codespaces)”。 -## Further reading +## 延伸阅读 -* "[Creating a new repository](/github/creating-cloning-and-archiving-repositories/creating-a-new-repository)" -* "[Deep dive into {% data variables.product.prodname_github_codespaces %}](/codespaces/getting-started/deep-dive#personalizing-your-codespace-with-extensions-or-plugins)" \ No newline at end of file +* [创建新存储库](/github/creating-cloning-and-archiving-repositories/creating-a-new-repository) +* “[深入了解 {% data variables.product.prodname_github_codespaces %}](/codespaces/getting-started/deep-dive#personalizing-your-codespace-with-extensions-or-plugins)” diff --git a/translations/zh-CN/content/codespaces/customizing-your-codespace/renaming-a-codespace.md b/translations/zh-CN/content/codespaces/customizing-your-codespace/renaming-a-codespace.md index 04b0d5b52f..bdc020d207 100644 --- a/translations/zh-CN/content/codespaces/customizing-your-codespace/renaming-a-codespace.md +++ b/translations/zh-CN/content/codespaces/customizing-your-codespace/renaming-a-codespace.md @@ -1,6 +1,6 @@ --- -title: Renaming a codespace -intro: 'You can change the codespace display name to one of your choice through {% data variables.product.prodname_dotcom_the_website %} or the {% data variables.product.prodname_cli %}.' +title: 重命名 codespace +intro: '可以通过 {% data variables.product.prodname_dotcom_the_website %} 或 {% data variables.product.prodname_cli %} 将 codespace 显示名称更改为所选名称之一。' versions: fpt: '*' ghec: '*' @@ -10,69 +10,74 @@ topics: - Fundamentals - Developer shortTitle: Rename a codespace +ms.openlocfilehash: dcb4558cce7ca0768524917a46cde2a49bacd1ce +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158715' --- +## 关于重命名 codespace -## About renaming a codespace +为每个 codespace 分配一个自动生成的显示名称。 如果有多个 codespace,则显示名称有助于区分不同 codespace。 例如:`literate space parakeet`。 可以更改 codespace 的显示名称。 -Each codespace is assigned an auto-generated display name. If you have multiple codespaces, the display name helps you to differentiate between codespaces. For example: `literate space parakeet`. You can change the display name for your codespace. +若要查找 codespace 的显示名称,请执行以下操作: -To find the display name of a codespace: +- 在 {% data variables.product.product_name %} 上,在 https://github.com/codespaces 处查看 codespace 列表。 -- On {% data variables.product.product_name %}, view your list of codespaces at https://github.com/codespaces. + ![GitHub 中 codespace 列表的屏幕截图](/assets/images/help/codespaces/codespaces-list-display-name.png) - ![Screenshot of the list of codespaces in GitHub](/assets/images/help/codespaces/codespaces-list-display-name.png) +- 在 {% data variables.product.prodname_vscode %} 桌面应用程序中,或在 {% data variables.product.prodname_vscode_shortname %} Web 客户端中,单击远程资源管理器。 显示名称是列表中的第二项。 例如:以下屏幕截图中的 `symmetrical space telegram`。 -- In the {% data variables.product.prodname_vscode %} desktop application, or the {% data variables.product.prodname_vscode_shortname %} web client, click the Remote Explorer. The display name is the second item in the list. For example: `symmetrical space telegram` in the screenshot below. - - ![Screenshot of the Remote Explorer in VS Code](/assets/images/help/codespaces/codespaces-remote-explorer.png) + ![VS Code 中远程资源管理器的屏幕截图](/assets/images/help/codespaces/codespaces-remote-explorer.png) {% indented_data_reference reusables.codespaces.remote-explorer spaces=2 %} -- In a terminal window on your local machine, use this {% data variables.product.prodname_cli %} command: `gh codespace list`. +- 在本地计算机上的终端窗口中,使用这条 {% data variables.product.prodname_cli %} 命令:`gh codespace list`。 -### Permanent codespace names +### 永久 codespace 名称 -In addition to the display name, when you create a codespace, a permanent name is also assigned to the codespace. The name is a combination of your {% data variables.product.company_short %} handle, and the auto-generated display name. For example: `octocat-literate-space-parakeet-mld5`. You can't change the permanent name. +创建 codespace 时,除了显示名称,还会向 codespace 分配永久名称。 该名称是 {% data variables.product.company_short %} 句柄以及自动生成的显示名称的组合。 例如:`octocat-literate-space-parakeet-mld5`。 无法更改永久名称。 -To find the permanent name of a codespace: +若要查找 codespace 的永久名称,请执行以下操作: -* On {% data variables.product.product_name %}, the permanent name is shown in a pop-up when you hover over the display name of a codespace on https://github.com/codespaces. +* 在 {% data variables.product.product_name %} 上,将鼠标悬停在 https://github.com/codespaces 上 codespace 的显示名称上时,永久名称会显示在弹出窗口中。 - ![Screenshot of the codespace name shown on hover over](/assets/images/help/codespaces/find-codespace-name-github.png) + ![悬停时显示的 codespace 名称的屏幕截图](/assets/images/help/codespaces/find-codespace-name-github.png) -* In a codespace, use this command in the terminal: `echo $CODESPACE_NAME`. -* In a terminal window on your local machine, use this {% data variables.product.prodname_cli %} command: `gh codespace list`. +* 在 codespace 中,在终端中使用此命令:`echo $CODESPACE_NAME`。 +* 在本地计算机上的终端窗口中,使用这条 {% data variables.product.prodname_cli %} 命令:`gh codespace list`。 -## Renaming a codespace +## 重命名 codespace -Changing the display name of a codespace can be useful if you have multiple codespaces that you will be using for an extended period. An appropriate name helps you identify a codespace that you use for a particular purpose. +如果有多个要在较长时间内使用的 codespace,更改 codespace 的显示名称可能很有用。 适当的名称有助于识别用于特定用途的 codespace。 {% cli %} -You can change the display name for your codespace by using the {% data variables.product.prodname_cli %}. +可以使用 {% data variables.product.prodname_cli %} 更改 codespace 的显示名称。 -To rename a codespace, use the `gh codespace edit` subcommand: +若要为 codespace 重命名,请使用 `gh codespace edit` 子命令: ```shell gh codespace edit -c PERMANENT-CODESPACE-NAME -d NEW-DISPLAY-NAME ``` -In this example, replace `PERMANENT-CODESPACE-NAME` with the permanent name of the codespace whose display name you want to change. Replace `NEW-DISPLAY-NAME` with the display name you want to use for this codespace. +在本例中,用想要更改其显示名称的 codespace 的永久名称替换 `PERMANENT-CODESPACE-NAME`。 用想用于此 codespace 的显示名称替换 `NEW-DISPLAY-NAME`。 -For more information, see "[Using {% data variables.product.prodname_github_codespaces %} with {% data variables.product.prodname_cli %}](/codespaces/developing-in-codespaces/using-github-codespaces-with-github-cli#rename-a-codespace)." +有关详细信息,请参阅“[将 {% data variables.product.prodname_github_codespaces %} 与 {% data variables.product.prodname_cli %} 配合使用](/codespaces/developing-in-codespaces/using-github-codespaces-with-github-cli#rename-a-codespace)。 {% endcli %} {% webui %} -You can change the display name for your codespace on {% data variables.product.prodname_dotcom_the_website %}. +可以在 {% data variables.product.prodname_dotcom_the_website %} 上更改 codespace 的显示名称。 {% data reusables.codespaces.your-codespaces-procedure-step %} The current display name for each of your codespaces is displayed. {% data reusables.codespaces.ellipsis-settings %} -1. Click **Rename**. +1. 单击“重命名”。 -1. In the prompt, under "Change display name to..." type your desired display name and click **OK**. +1. 在提示符中,在“将显示名称更改为...”下键入所需的显示名称,然后单击“ 确定”。 -{% endwebui %} \ No newline at end of file +{% endwebui %} diff --git a/translations/zh-CN/content/codespaces/customizing-your-codespace/setting-your-default-editor-for-github-codespaces.md b/translations/zh-CN/content/codespaces/customizing-your-codespace/setting-your-default-editor-for-github-codespaces.md index ad415c4536..279e9d72e1 100644 --- a/translations/zh-CN/content/codespaces/customizing-your-codespace/setting-your-default-editor-for-github-codespaces.md +++ b/translations/zh-CN/content/codespaces/customizing-your-codespace/setting-your-default-editor-for-github-codespaces.md @@ -1,5 +1,5 @@ --- -title: Setting your default editor for GitHub Codespaces +title: 设置 GitHub Codespaces 的默认编辑器 shortTitle: Set the default editor intro: '{% data reusables.codespaces.about-changing-default-editor %}' versions: @@ -11,40 +11,44 @@ redirect_from: topics: - Codespaces type: how_to +ms.openlocfilehash: 5c286ffe8f96d275dc0b20949a87b7ced411c9af +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159443' --- - -On the settings page, you can set your editor preference so that when you create a codespace, or open an existing codespace, it is opened in your choice of: -* {% data variables.product.prodname_vscode %} (desktop application) -* {% data variables.product.prodname_vscode %} (web client application) -* JetBrains Gateway - for opening codespaces in a JetBrains IDE -* JupyterLab - the web interface for Project Jupyter +在“设置”页上,可以设置编辑器首选项,以便在创建 codespace 或打开现有 codespace 时,它会在所选的以下选项中打开: +* {% data variables.product.prodname_vscode %}(桌面应用程序) +* {% data variables.product.prodname_vscode %}(Web 客户端应用程序) +* JetBrains 网关 - 用于在 JetBrains IDE 中打开 codespace +* JupyterLab - Project Jupyter 的 Web 接口 {% data reusables.codespaces.template-codespaces-default-editor %} -If you want to use {% data variables.product.prodname_vscode %} as your default editor for {% data variables.product.prodname_github_codespaces %}, you need to install {% data variables.product.prodname_vscode %} and the {% data variables.product.prodname_github_codespaces %} extension for {% data variables.product.prodname_vscode %}. For more information, see the [download page for {% data variables.product.prodname_vscode %}](https://code.visualstudio.com/download/) and the [{% data variables.product.prodname_github_codespaces %} extension on the {% data variables.product.prodname_vscode %} marketplace](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces). +如果要将 {% data variables.product.prodname_vscode %} 用作 {% data variables.product.prodname_github_codespaces %} 的默认编辑器,则需要安装 {% data variables.product.prodname_vscode %} 和 {% data variables.product.prodname_vscode %} 的 {% data variables.product.prodname_github_codespaces %} 扩展。 有关详细信息,请参阅 [{% data variables.product.prodname_vscode %} 的下载页](https://code.visualstudio.com/download/)和 [{% data variables.product.prodname_vscode %} 市场中的 {% data variables.product.prodname_github_codespaces %} 扩展](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces)。 -If you want to work on a codespace in a JetBrains IDE you must install the JetBrains Gateway. For more information, see "[Using {% data variables.product.prodname_github_codespaces %} in your JetBrains IDE](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide)." +如果要在 JetBrains IDE 中使用 codespace,则必须安装 JetBrains 网关。 有关详细信息,请参阅“[在 JetBrains IDE 中使用 {% data variables.product.prodname_github_codespaces %}](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide)”。 -## Setting your default editor +## 设置默认编辑器 -{% data reusables.user-settings.access_settings %} -{% data reusables.user-settings.codespaces-tab %} -1. Under "Editor preference", select the option you want. +{% data reusables.user-settings.access_settings %} {% data reusables.user-settings.codespaces-tab %} +1. 在“Editor preference(编辑器首选项)”下,选择所需的选项。 - ![Setting your editor](/assets/images/help/codespaces/select-default-editor.png) + ![设置编辑器](/assets/images/help/codespaces/select-default-editor.png) * {% data reusables.codespaces.application-installed-locally %}

- * If you choose **{% data variables.product.prodname_vscode %}**, {% data variables.product.prodname_github_codespaces %} will automatically open in the desktop application when you next create or open a codespace. + * 如果选择“{% data variables.product.prodname_vscode %}”,在下次创建或打开 codespace 时,{% data variables.product.prodname_github_codespaces %} 将自动在桌面应用程序中打开。 - You may need to allow access to both your browser and {% data variables.product.prodname_vscode %} for it to open successfully.

+ 您可能需要同时允许访问浏览器和 {% data variables.product.prodname_vscode %} 才能成功打开。

- * If you choose **JetBrains Gateway**, the Gateway application will automatically open when you next create or open a codespace. + * 如果选择“JetBrains 网关”,则下次创建或打开 codespace 时,网关应用程序将自动打开。 - The first time you open a codespace this way you must give permission to open the application. + 首次以这种方式打开 codespace 时,必须授予打开该应用程序的权限。 - The Gateway application will open and the codespace will then be automatically selected. You can then choose a JetBrains IDE, if you have not previously done so, and click **Connect** to open the codespace in the JetBrains client. For more information, see "[Using {% data variables.product.prodname_github_codespaces %} in your JetBrains IDE](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide)." + 网关应用程序将打开,然后会自动选择 codespace。 然后,可以选择 JetBrains IDE(如果之前没有选择),然后单击“连接”在 JetBrains 客户端中打开 codespace。 有关详细信息,请参阅“[在 JetBrains IDE 中使用 {% data variables.product.prodname_github_codespaces %}](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide)”。 - To connect to a codespace from the Gateway application, you must have an SSH server running on the codespace. {% indented_data_reference reusables.codespaces.ssh-server-installed spaces=5 %} + 若要从网关应用程序连接到 codespace,必须在 codespace 上运行 SSH 服务器。 {% indented_data_reference reusables.codespaces.ssh-server-installed spaces=5 %} - * If you choose **JupyterLab**, the JupyterLab application must be installed in the codespaces you open. {% data reusables.codespaces.jupyterlab-in-default-image %} + * 如果选择“JupyterLab”,则必须在打开的 codespace 中安装 JupyterLab 应用程序。 {% data reusables.codespaces.jupyterlab-in-default-image %} diff --git a/translations/zh-CN/content/codespaces/customizing-your-codespace/setting-your-timeout-period-for-github-codespaces.md b/translations/zh-CN/content/codespaces/customizing-your-codespace/setting-your-timeout-period-for-github-codespaces.md index ab0e7be5ee..fcdc736dd5 100644 --- a/translations/zh-CN/content/codespaces/customizing-your-codespace/setting-your-timeout-period-for-github-codespaces.md +++ b/translations/zh-CN/content/codespaces/customizing-your-codespace/setting-your-timeout-period-for-github-codespaces.md @@ -1,7 +1,7 @@ --- -title: Setting your timeout period for GitHub Codespaces +title: 设置 GitHub Codespaces 超时期限 shortTitle: Set the timeout -intro: 'You can set your default timeout for {% data variables.product.prodname_github_codespaces %} in your personal settings page.' +intro: '可以在个人设置页面中设置 {% data variables.product.prodname_github_codespaces %} 的默认超时。' versions: fpt: '*' ghec: '*' @@ -10,53 +10,57 @@ topics: type: how_to redirect_from: - /codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces +ms.openlocfilehash: 6ca559fefddc34eb6de0441d17344ff8054db509 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159442' --- +## 关于空闲超时 -## About the idle timeout - -A codespace will stop running after a period of inactivity. By default this period is 30 minutes, but you can specify a longer or shorter default timeout period in your personal settings on {% data variables.product.prodname_dotcom %}. The updated setting will apply to any new codespaces you create, or to existing codespaces the next time you start them. You can also specify a timeout when you use {% data variables.product.prodname_cli %} to create a codespace. +代码空间将在一段时间不活动后停止运行。 默认情况下,此时间段为 30 分钟,但你可以在 {% data variables.product.prodname_dotcom %} 上的个人设置中指定更长或更短的默认超时期限。 更新后的设置将应用于你创建的任何新 codespaces,或者在下次启动 codespaces 时应用于现有 codespaces。 还可以在使用 {% data variables.product.prodname_cli %} 创建 codespace 时指定超时。 {% warning %} -**Warning**: Codespaces compute usage is billed for the duration for which a codespace is active. If you're not using a codespace but it remains running, and hasn't yet timed out, you are billed for the total time that the codespace was active, irrespective of whether you were using it. For more information, see "[About billing for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#codespaces-pricing)." +警告:在 codespace 处于活动状态期间对 codespaces 计算用量计费。 如果未使用 codespace,但它仍在运行,并且尚未超时,则无论是否正在使用 codespace,你都需按 codespace 处于活动状态的总时间付费。 有关详细信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#codespaces-pricing)”。 {% endwarning %} -### Timeout periods for organization-owned repositories +### 组织拥有的存储库的超时时段 -Organizations can set a maximum idle timeout policy for codespaces created from some or all of their repositories. If an organization policy sets a maximum timeout which is less than the default timeout you have set, the organization's timeout will be used instead of your setting. You will be notified of this after the codespace is created. For more information, see "[Restricting the idle timeout period](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)." +组织可以为从其部分或所有存储库创建的 codespace 设置最大空闲超时策略。 如果组织策略设置的最大超时时间少于你设置的默认超时时间,将使用组织的超时时间而不是你设置的超时时间。 你将在 codespace 创建后收到此通知。 有关详细信息,请参阅“[限制空闲超时期限](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)”。 {% webui %} -## Setting your default timeout period +## 设置默认超时期限 -{% data reusables.user-settings.access_settings %} -{% data reusables.user-settings.codespaces-tab %} -1. Under "Default idle timeout", enter the time that you want, then click **Save**. The time must be between 5 minutes and 240 minutes (4 hours). - ![Selecting your timeout](/assets/images/help/codespaces/setting-default-timeout.png) +{% data reusables.user-settings.access_settings %} {% data reusables.user-settings.codespaces-tab %} +1. 在“默认空闲超时”下,输入所需时间,然后单击“保存”。 时间必须在 5 分钟到 240 分钟(4 小时)之间。 + ![选择超时](/assets/images/help/codespaces/setting-default-timeout.png) {% endwebui %} {% cli %} -## Setting the timeout period for a codespace +## 设置 codespace 的超时期限 {% data reusables.cli.cli-learn-more %} -To set the timeout period when you create a codespace, use the `idle-timeout` argument with the `codespace create` subcommand. Specify the time in minutes, followed by `m`. The time must be between 5 minutes and 240 minutes (4 hours). +若要设置创建代码空间时的超时期限,请将 `idle-timeout` 参数与 `codespace create` 子命令一起使用。 指定以分钟为单位的时间,后跟 `m`。 时间必须在 5 分钟到 240 分钟(4 小时)之间。 ```shell gh codespace create --idle-timeout 90m ``` -If you don't specify a timeout period when you create a codespace, then the default timeout period will be used. For information about setting a default timeout period, click the "Web browser" tab on this page. You can't currently specify a default timeout period through {% data variables.product.prodname_cli %}. +如果在创建代码空间时未指定超时期限,则将使用默认超时期限。 有关设置默认超时期限的信息,请单击此页面上的“Web browser(Web 浏览器)”选项卡。 您当前无法通过 {% data variables.product.prodname_cli %} 指定默认超时期限。 {% endcli %} {% vscode %} -## Setting a timeout period +## 设置超时期限 -You can set your default timeout period in your web browser, on {% data variables.product.prodname_dotcom_the_website %}. Alternatively, if you use {% data variables.product.prodname_cli %} to create a codespace you can set a timeout period for that particular codespace. For more information, click the appropriate tab above. +可以通过 Web 浏览器在 {% data variables.product.prodname_dotcom_the_website %} 上设置默认超时期限。 或者,如果使用 {% data variables.product.prodname_cli %} 创建 codespace,则可以为该特定 codespace 设置超时期限。 有关详细信息,请单击上面相应的选项卡。 {% endvscode %} diff --git a/translations/zh-CN/content/codespaces/developing-in-codespaces/connecting-to-a-private-network.md b/translations/zh-CN/content/codespaces/developing-in-codespaces/connecting-to-a-private-network.md index bdaddaa45e..7af2bd9901 100644 --- a/translations/zh-CN/content/codespaces/developing-in-codespaces/connecting-to-a-private-network.md +++ b/translations/zh-CN/content/codespaces/developing-in-codespaces/connecting-to-a-private-network.md @@ -1,6 +1,6 @@ --- -title: Connecting to a private network -intro: 'You can connect {% data variables.product.prodname_github_codespaces %} to resources on a private network, including package registries, license servers, and on-premises databases.' +title: 连接到专用网络 +intro: '可以将 {% data variables.product.prodname_github_codespaces %} 连接到专用网络上的资源,包括包注册表、许可证服务器和本地数据库。' versions: fpt: '*' ghec: '*' @@ -9,51 +9,56 @@ topics: - Codespaces - Fundamentals - Developer +ms.openlocfilehash: 92b8f2b9ea438a4cc799aec1969ff6773f90c298 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159441' --- +## 关于代码空间网络 -## About codespace networking +默认情况下,您的代码空间有权访问公共 Internet 上的所有资源,包括包管理器、许可证服务器、数据库和云平台 API,但它们无权访问专用网络上的资源。 -By default, your codespaces have access to all resources on the public internet, including package managers, license servers, databases, and cloud platform APIs, but they have no access to resources on private networks. +## 连接到专用网络上的资源 -## Connecting to resources on a private network +目前,在 {% data variables.product.prodname_github_codespaces %} 内访问专用网络上的资源有两种方法。 +- 使用 {% data variables.product.prodname_cli %} 扩展将本地计算机配置为远程资源的网关。 +- 使用 VPN。 -There are currently two methods of accessing resources on a private network within {% data variables.product.prodname_github_codespaces %}. -- Using a {% data variables.product.prodname_cli %} extension to configure your local machine as a gateway to remote resources. -- Using a VPN. - -### Using the GitHub CLI extension to access remote resources +### 使用 GitHub CLI 扩展访问远程资源 {% note %} -**Note**: The {% data variables.product.prodname_cli %} extension is currently in beta and subject to change. +注意:{% data variables.product.prodname_cli %} 扩展目前为 beta 版本,可能会有变动。 {% endnote %} -The {% data variables.product.prodname_cli %} extension allows you to create a bridge between a codespace and your local machine, so that the codespace can access any remote resource that is accessible from your machine. The codespace uses your local machine as a network gateway to reach those resources. For more information, see "[Using {% data variables.product.prodname_cli %} to access remote resources](https://github.com/github/gh-net#codespaces-network-bridge)." +可以使用 {% data variables.product.prodname_cli %} 扩展在 codespace 和本地计算机之间创建网桥,以便 codespace 可以访问可从计算机访问的任何远程资源。 codespace 使用本地计算机作为网络网关访问这些资源。 有关详细信息,请参阅“[使用 {% data variables.product.prodname_cli %} 访问远程资源](https://github.com/github/gh-net#codespaces-network-bridge)”。 -### Using a VPN to access resources behind a private network +### 使用 VPN 访问专用网络后面的资源 -As an alternative to the {% data variables.product.prodname_cli %} extension, you can use a VPN to access resources behind a private network from within your codespace. +作为 {% data variables.product.prodname_cli %} 扩展的替代方法,可以使用 VPN 从 codespace 内访问专用网络后面的资源。 -We recommend VPN tools like [OpenVPN](https://openvpn.net/) to access resources on a private network. For more information, see "[Using the OpenVPN client from {% data variables.product.prodname_github_codespaces %}](https://github.com/codespaces-contrib/codespaces-openvpn)." +建议使用 [OpenVPN](https://openvpn.net/) 等 VPN工具访问专用网络上的资源。 有关详细信息,请参阅“[从 {% data variables.product.prodname_github_codespaces %} 使用 OpenVPN 客户端](https://github.com/codespaces-contrib/codespaces-openvpn)”。 -There are also a number of third party solutions that, while not explicitly endorsed by {% data variables.product.prodname_dotcom %}, have provided examples of how to integrate with {% data variables.product.prodname_github_codespaces %}. +还有一些第三方解决方案虽然没有得到 {% data variables.product.prodname_dotcom %} 的明确认可,但提供了如何与 {% data variables.product.prodname_github_codespaces %} 集成的示例。 -These third party solutions include: +这些第三方解决方案包括: - [Tailscale](https://tailscale.com/kb/1160/github-codespaces/) -### Allowlisting private resources for codespaces +### 将代码空间的私有资源列入允许列表 -While {% data variables.product.prodname_dotcom %} publishes IP ranges for several products on its Meta API, codespaces IPs are dynamically assigned, meaning your codespace is not guaranteed to have the same IP address day to day. We highly discourage users from allowlisting an entire IP range, as this would give overly broad access to all codespaces (including users not affiliated with your codespaces). +虽然 {% data variables.product.prodname_dotcom %} 在其 Meta API 上发布多个产品的 IP 范围,但代码空间 IP 是动态分配的,这意味着您的代码空间不能保证每天具有相同的 IP 地址。 我们强烈建议用户不要允许列出整个 IP 范围,因为这样用户能够过于宽泛地访问所有代码空间(包括与您的代码空间无关的用户)。 -For more information about the Meta API, see "[Meta](/rest/reference/meta)." +有关 Meta API 的详细信息,请参阅“[Meta](/rest/reference/meta)”。 -## Restricting access to the public internet +## 限制对公共互联网的访问 -At present, there is no way to restrict codespaces from accessing the public internet, or to restrict appropriately authenticated users from accessing a forwarded port. +目前,没有办法限制代码空间访问公共互联网,或者限制经过适当身份验证的用户访问转发端口。 -For more information on how to secure your codespaces, see "[Security in {% data variables.product.prodname_github_codespaces %}](/codespaces/codespaces-reference/security-in-github-codespaces)." +有关如何保护 codespace 的详细信息,请参阅“[{% data variables.product.prodname_github_codespaces %} 中的安全性](/codespaces/codespaces-reference/security-in-github-codespaces)”。 diff --git a/translations/zh-CN/content/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository.md b/translations/zh-CN/content/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository.md new file mode 100644 index 0000000000..e4492c0bb6 --- /dev/null +++ b/translations/zh-CN/content/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository.md @@ -0,0 +1,145 @@ +--- +title: Creating a codespace for a repository +intro: You can create a codespace for a branch in a repository to develop online. +redirect_from: + - /github/developing-online-with-github-codespaces/creating-a-codespace + - /github/developing-online-with-codespaces/creating-a-codespace + - /codespaces/developing-in-codespaces/creating-a-codespace +versions: + fpt: '*' + ghec: '*' +type: how_to +topics: + - Codespaces + - Fundamentals + - Developer +shortTitle: Create a codespace for a repo +--- + +## About creating a codespace for a repository + +{% data reusables.codespaces.ways-to-create-a-codespace %} Use the tabs in this article to display instructions for each of these ways of creating a codespace. + +{% data reusables.codespaces.starting-new-project-template %} For more information, see "[Creating a codespace from a template](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template)." + +{% note %} + +**Note**: If you use a JetBrains IDE, you can use {% data variables.product.prodname_cli %} to create a codespace. You can then use the JetBrains Gateway application to open the codespace in a JetBrains IDE. For more information, see "[Using Codespaces in your JetBrains IDE](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide)." + +{% endnote %} + +You can use {% data variables.product.prodname_github_codespaces %} on your personal {% data variables.product.prodname_dotcom_the_website %} account, with the quota of free use included each month for accounts on the Free and Pro plans. {% data reusables.codespaces.codespaces-continue-by-paying %} + +Organizations can enable members and outside collaborators to create and use codespaces at the organization's expense. For more information, see "[Enabling {% data variables.product.prodname_github_codespaces %} for your organization](/codespaces/managing-codespaces-for-your-organization/enabling-github-codespaces-for-your-organization)." + +{% data reusables.codespaces.codespaces-are-personal %} + +If you create a codespace from a repository, the codespace will be associated with a specific branch, which cannot be empty. You can create more than one codespace per repository or even per branch. + +{% data reusables.codespaces.you-can-see-all-your-codespaces %} + +### The codespace creation process + +When you create a codespace, a number of steps happen to create and connect you to your development environment: + +- Step 1: VM and storage are assigned to your codespace. +- Step 2: Container is created and your repository is cloned. +- Step 3: You can connect to the codespace. +- Step 4: Codespace continues with post-creation setup. + +For more information on what happens when you create a codespace, see "[Deep Dive](/codespaces/getting-started/deep-dive)." + +For more information on the lifecycle of a codespace, see "[The codespace lifecycle](/codespaces/developing-in-codespaces/the-codespace-lifecycle)." + +If you want to use Git hooks for your codespace, then you should set up hooks using the [`devcontainer.json` lifecycle scripts](https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_lifecycle-scripts), such as `postCreateCommand`, during step 4. Since your codespace container is created after the repository is cloned, any [git template directory](https://git-scm.com/docs/git-init#_template_directory) configured in the container image will not apply to your codespace. Hooks must instead be installed after the codespace is created. For more information on using `postCreateCommand`, see the [`devcontainer.json` reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_devcontainerjson-properties) in the {% data variables.product.prodname_vscode_shortname %} documentation. + +{% data reusables.codespaces.use-visual-studio-features %} + +{% data reusables.codespaces.prebuilds-crossreference %} + +## Creating a codespace for a repository + +{% webui %} + +{% data reusables.repositories.navigate-to-repo %} +1. Under the repository name, use the "Branch" dropdown menu, and select the branch you want to create a codespace for. + + ![Branch dropdown menu](/assets/images/help/codespaces/branch-drop-down.png) + +1. Click the **{% octicon "code" aria-label="The code icon" %} Code** button, then click the **Codespaces** tab. + + ![New codespace button](/assets/images/help/codespaces/new-codespace-button.png) + + If codespaces for this repository are billable to an organization, or its parent enterprise, a message is displayed below the **Create codespace on BRANCH** button telling you who will pay for the codespace. + +1. Create your codespace, either using the default options, or after configuring advanced options: + + * **Use the default options** + + To create a codespace using the default options, click the plus sign ({% octicon "plus" aria-label="The plus icon" %}). Alternatively, if you don't currently have any codespaces for this repository, you can click **Create codespace on BRANCH**. + + * **Configure options** + + To configure advanced options for your codespace, such as a different machine type or a particular `devcontainer.json` file: + + 1. Click the ellipsis (**...**) at the top right of the **Codespaces** tab and select **New with options**. + + ![View the default machine type](/assets/images/help/codespaces/default-machine-type.png) + + 1. On the options page for your codespace, choose your preferred options from the dropdown menus. + + ![The codespace options page](/assets/images/help/codespaces/advanced-options.png) + + {% note %} + + **Notes** + + * You can bookmark the options page to give you a quick way to create a codespace for this repository and branch. + * The [https://github.com/codespaces/new](https://github.com/codespaces/new) page provides a quick way to create a codespace for any repository and branch. You can get to this page quickly by typing `codespace.new` into your browser's address bar. + * For more information about the `devcontainer.json` file, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#devcontainerjson)." + * For more information about machine types, see "[Changing the machine type for your codespace](/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace#about-machine-types)." + * {% data reusables.codespaces.codespaces-machine-type-availability %} + + {% endnote %} + + 1. Click **Create codespace**. + +{% endwebui %} + +{% vscode %} + +{% data reusables.codespaces.creating-a-codespace-in-vscode %} + +{% endvscode %} + +{% cli %} + +{% data reusables.cli.cli-learn-more %} + +To create a new codespace, use the `gh codespace create` subcommand. + +```shell +gh codespace create +``` + +You are prompted to choose a repository. If codespaces for this repository are billable to an organization, or its parent enterprise, a message is displayed telling you who will pay for the codespace. You are then prompted to choose a branch, a dev container configuration file (if more than one is available), and a machine type (if more than one is available). + +Alternatively, you can use flags to specify some or all of the options: + +```shell +gh codespace create -r OWNER/REPO -b BRANCH --devcontainer-path PATH -m MACHINE-TYPE +``` + +In this example, replace `owner/repo` with the repository identifier. Replace `branch` with the name of the branch, or the full SHA hash of the commit, that you want to be initially checked out in the codespace. If you use the `-r` flag without the `b` flag, the codespace is created from the default branch. + +Replace `path` with the path to the dev container configuration file you want to use for the new codespace. If you omit this flag and more than one dev container file is available you will be prompted to choose one from a list. For more information about the dev container configuration file, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)." + +Replace `machine-type` with a valid identifier for an available machine type. Identifiers are strings such as: `basicLinux32gb` and `standardLinux32gb`. The type of machines that are available depends on the repository, your personal account, and your location. If you enter an invalid or unavailable machine type, the available types are shown in the error message. If you omit this flag and more than one machine type is available you will be prompted to choose one from a list. + +For full details of the options for this command, see [the {% data variables.product.prodname_cli %} manual](https://cli.github.com/manual/gh_codespace_create). + +{% endcli %} + +## Further reading +- "[Opening an existing codespace](/codespaces/developing-in-codespaces/opening-an-existing-codespace)" +- "[Adding an 'Open in {% data variables.product.prodname_github_codespaces %}' badge](/codespaces/setting-up-your-project-for-codespaces/adding-a-codespaces-badge)" diff --git a/translations/zh-CN/content/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template.md b/translations/zh-CN/content/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template.md new file mode 100644 index 0000000000..1f90ae0e98 --- /dev/null +++ b/translations/zh-CN/content/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template.md @@ -0,0 +1,102 @@ +--- +title: Creating a codespace from a template +intro: If you're starting a new project, you can create a codespace from a blank template or choose a template specially designed for the type of work you want to do. +versions: + fpt: '*' + ghec: '*' +type: how_to +topics: + - Codespaces + - Fundamentals + - Developer +shortTitle: Create a codespace from a template +miniTocMaxHeadingLevel: 3 +--- + +## About templates for {% data variables.product.prodname_github_codespaces %} + +If you're starting a new project, you can get started with development work quickly by creating a codespace from a template. You'll be able to work on your project in a cloud-based development environment, save your files in the cloud, and publish your work to a new remote repository that you can share with others or clone to your local machine. + +{% note %} + +**Note**: Codespaces created from a template, rather than from a repository, are always billed to your personal account. For more information, see "[About billing for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)." + +{% endnote %} + +You can start from a blank template, choose from templates maintained by {% data variables.product.company_short %} for popular technologies such as React or Jupyter Notebook, or launch a codespace from any template repository on {% data variables.product.prodname_dotcom %}. With a blank template, you'll start with an empty directory, with access to cloud-based compute resources and the tools, languages, and runtime environments that come preinstalled with the default codespace image. With other templates, you'll get starter files for the technology you're working with, plus typically some extra files such as a README file, a `.gitignore` file, and dev container configuration files containing some custom environment configuration. For more information on dev containers and the default image, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)." + +As an example, if you create a codespace from {% data variables.product.company_short %}'s React template, you'll arrive in a workspace containing template files for a simple application, such as `index.js`, `app.js`, and `package.json`. Shortly after the codespace opens, a development server will start up automatically, and you will be able to view the running application in a simple browser tab within the {% data variables.product.prodname_vscode_shortname %} web client. + +![Screenshot of the React template running in a codespace](/assets/images/help/codespaces/react-template.png) + +The files and configuration included in templates are defined in template repositories. The template repository is cloned into your codespace when you create the codespace. After that, the link is severed, and your codespace won't be linked to a remote repository until you publish to one. + +{% tip %} + +**Tip:** To help people get started with your framework, library, or other project, you can set up a template repository for use with {% data variables.product.prodname_github_codespaces %}. For more information, see "[Setting up a template repository for {% data variables.product.prodname_github_codespaces %}](/codespaces/setting-up-your-project-for-codespaces/setting-up-a-template-repository-for-github-codespaces)." + +{% endtip %} + +## Creating a codespace from a {% data variables.product.company_short %} template + +Templates maintained by {% data variables.product.company_short %}, including the blank template, are available from the "Your codespaces" page. + +{% data reusables.codespaces.your-codespaces-procedure-step %} +{% data reusables.codespaces.view-all-templates-step %} +1. Optionally, to view the template repository containing the files for a template, click the name of the template. + + ![Screenshot of the "Explore quick start templates" section, with "React" highlighted](/assets/images/help/codespaces/react-template-name.png) + +1. Under the template you want to launch, click **Use this template**. + + ![Screenshot of the quick start templates, with the "Use this template" button highlighted under the React template](/assets/images/help/codespaces/react-template-button.png) + +{% data reusables.codespaces.template-codespaces-default-editor %} + +## Creating a codespace from a template repository + +You can create a codespace from any template repository, then publish your work to a new repository when you are ready. For more information on template repositories, see "[Creating a repository from a template](/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template#about-repository-templates)." + +{% data reusables.repositories.navigate-to-repo %} +{% data reusables.codespaces.open-template-in-codespace-step %} + + {% note %} + + **Note:** If you're a maintainer of the template repository, and want to commit changes to the template repository itself, you should create a codespace from the **{% octicon "code" aria-label="The code icon" %} Code** dropdown. For more information, see "[Creating a codespace for a repository](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)." + + {% endnote %} + +{% data reusables.codespaces.template-codespaces-default-editor %} + +## Publishing to a repository on {% data variables.product.product_name %} + +{% data reusables.codespaces.about-publishing-templates %} + +### Publishing from {% data variables.product.prodname_vscode_shortname %} + +{% data reusables.codespaces.publishing-template-codespaces %} + +When a codespace is published, you have access to a greater range of options to customize your {% data variables.product.prodname_github_codespaces %} experience. For example, you can: + +- Change the machine type of your codespace to make sure you're using resources appropriate for the work you're doing (see "[Changing the machine type for your codespace](/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace)"). +- Allow {% data variables.product.prodname_dotcom %} to automatically use GPG to sign commits you make in your codespace (see "[Managing GPG verification for {% data variables.product.prodname_github_codespaces %}](/codespaces/managing-your-codespaces/managing-gpg-verification-for-github-codespaces)"). +- Share encrypted secrets with your codespace (see "[Managing encrypted secrets for your codespaces](/codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces)"). + +### Publishing from {% data variables.product.prodname_dotcom_the_website %} + +You can publish an unpublished codespace from the "Your codespaces" page on {% data variables.product.prodname_dotcom_the_website %}. This is useful if you want to publish a codespace that you don't currently have open in your browser. If you do this, your work will be preserved in a repository, but there won't be a link between your existing codespace and the new repository. However, you can navigate to the new repository and create a codespace from there, and this codespace will be connected to the repository. + +{% data reusables.codespaces.your-codespaces-procedure-step %} +1. Next to the unpublished codespace, click the ellipsis (**...**), then select **Publish to a new repository**. + + ![Screenshot of the "Publish to a new repository" button](/assets/images/help/codespaces/publish-to-new-repository.png) +1. Choose a name for your new repository, set it as **Public** or **Private**, and click **Create repository**. + + ![Screenshot of the "Publish to a new repository" dropdown](/assets/images/help/codespaces/template-new-repository-settings.png) +1. Optionally, to view the new repository, click **See repository**. + +## Further reading + +- "[Creating a codespace for a repository](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository)" +- "[The codespace lifecycle](/codespaces/developing-in-codespaces/the-codespace-lifecycle)" +- "[Using source control in your codespace](/codespaces/developing-in-codespaces/using-source-control-in-your-codespace)" \ No newline at end of file diff --git a/translations/zh-CN/content/codespaces/developing-in-codespaces/deleting-a-codespace.md b/translations/zh-CN/content/codespaces/developing-in-codespaces/deleting-a-codespace.md index c004006e66..3ee8f6ea99 100644 --- a/translations/zh-CN/content/codespaces/developing-in-codespaces/deleting-a-codespace.md +++ b/translations/zh-CN/content/codespaces/developing-in-codespaces/deleting-a-codespace.md @@ -1,6 +1,6 @@ --- -title: Deleting a codespace -intro: You can delete a codespace you no longer need. +title: 删除代码空间 +intro: 您可以删除不再需要的代码空间。 redirect_from: - /github/developing-online-with-github-codespaces/deleting-a-codespace - /github/developing-online-with-codespaces/deleting-a-codespace @@ -13,28 +13,33 @@ topics: - Fundamentals - Developer shortTitle: Delete a codespace +ms.openlocfilehash: c9f1f6eb407c985d8981504de28e39a4bf742f7a +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158659' --- - -You can delete a codespace in a variety of ways: in the terminal by using {% data variables.product.prodname_cli %}, in {% data variables.product.prodname_vscode %}, or in your web browser. Use the tabs in this article to display instructions for each of these ways of deleting a codespace. +可以通过多种方式删除 codespace:在终端中使用 {% data variables.product.prodname_cli %}、在 {% data variables.product.prodname_vscode %} 中或在 Web 浏览器中。 使用本文中的选项卡可显示删除 codespace 的每种方法的说明。 {% note %} -**Note**: You can't delete a codespace from within the JetBrains Gateway, or the JetBrains client application, or from within JupyterLab. +注意:无法从 JetBrains 网关或 JetBrains 客户端应用程序或 JupyterLab 中删除 codespace。 {% endnote %} -There are costs associated with storing codespaces. You should therefore delete any codespaces you no longer need. For more information, see "[About billing for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)." +存储 codespace 会产生费用。 因此,应删除任何不再需要的 codespace。 有关详细信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)”。 {% data reusables.codespaces.max-number-codespaces %} -## Deleting a codespace +## 删除代码空间 {% webui %} {% data reusables.codespaces.your-codespaces-procedure-step %} -1. To the right of the codespace you want to delete, click {% octicon "kebab-horizontal" aria-label="The horizontal kebab icon" %}, then click **{% octicon "trash" aria-label="The trash icon" %} Delete** +1. 在要删除的代码空间的右侧,单击 {% octicon "kebab-horizontal" aria-label="The horizontal kebab icon" %},然后单击“{% octicon "trash" aria-label="The trash icon" %}删除”。 - ![Delete button](/assets/images/help/codespaces/delete-codespace.png) + ![“删除”按钮](/assets/images/help/codespaces/delete-codespace.png) {% endwebui %} @@ -49,48 +54,48 @@ There are costs associated with storing codespaces. You should therefore delete {% data reusables.cli.cli-learn-more %} -To delete a codespace use the `gh codespace delete` subcommand and then choose a codespace from the list that's displayed. +若要删除代码空间,请使用 `gh codespace delete` 子命令,然后从显示的列表中选择一个代码空间。 ```shell gh codespace delete ``` -If you have unsaved changes, you'll be prompted to confirm deletion. You can use the `--force` flag to force deletion, avoiding this prompt. +如果您有未保存的更改,系统将提示您确认删除。 可以使用 `--force` 标志强制删除,从而避免出现此提示。 -For more information about this command, see [the {% data variables.product.prodname_cli %} manual](https://cli.github.com/manual/gh_codespace_delete). +有关此命令的详细信息,请参阅 [{% data variables.product.prodname_cli %} 手册](https://cli.github.com/manual/gh_codespace_delete)。 {% endcli %} -## Bulk deleting codespaces +## 批量删除 codespace {% webui %} -You can use {% data variables.product.prodname_cli %} to delete several or all of your codespaces with a single command. For more information, click the "{% data variables.product.prodname_cli %}" tab near the top of this page. +可以使用 {% data variables.product.prodname_cli %} 通过单个命令删除多个或所有 codespace。 有关详细信息,请单击此页面顶部附近的“{% data variables.product.prodname_cli %}”选项卡。 {% endwebui %} {% vscode %} -You can use {% data variables.product.prodname_cli %} to delete several or all of your codespaces with a single command. For more information, click the "{% data variables.product.prodname_cli %}" tab near the top of this page. +可以使用 {% data variables.product.prodname_cli %} 通过单个命令删除多个或所有 codespace。 有关详细信息,请单击此页面顶部附近的“{% data variables.product.prodname_cli %}”选项卡。 {% endvscode %} {% cli %} -You can delete several or all of your codespaces with a single command, using `gh codespace delete` followed by one of these flags: +可以使用单个命令并在 `gh codespace delete` 后使用以下标志之一来删除多个或所有 codespace: -`--all` - Delete all of your codespaces. +`--all` - 删除所有 codespace。 -`--repo REPOSITORY` - Delete all of your codespaces for this repository. Or use together with the `--days` flag to filter by age of the codespace. +`--repo REPOSITORY` - 删除此存储库的所有 codespace。 或者与 `--days` 标志一起使用,按 codespace 的存在时长进行筛选。 -`--days NUMBER` - Delete all of your codespaces that are older than the specified number of days. Can be used together with the `--repo` flag. +`--days NUMBER` - 删除早于指定天数的所有 codespace。 可以与 `--repo` 标志一起使用。 -By default you are prompted to confirm deletion of any codespaces that contain unsaved changes. You can use the `--force` flag to skip this confirmation. +默认情况下,系统会提示确认删除包含未保存更改的任何 codespace。 可以使用 `--force` 标志跳过此确认。 -### Example +### 示例 -Delete all of the codespaces for the `octo-org/octo-repo` repository that you created more than 7 days ago. +删除 `octo-org/octo-repo` 存储库 7 天前创建的所有 codespace。 ``` gh codespace delete --repo octo-org/octo-repo --days 7 @@ -98,37 +103,37 @@ gh codespace delete --repo octo-org/octo-repo --days 7 {% endcli %} -## Deleting codespaces in your organization +## 删除组织中的 codespace -As an organization owner, you can use {% data variables.product.prodname_cli %} to delete any codespace in your organization. +作为组织所有者,可以使用 {% data variables.product.prodname_cli %} 删除组织中的任何 codespace。 {% webui %} -For more information, click the "{% data variables.product.prodname_cli %}" tab near the top of this page. +有关详细信息,请单击此页面顶部附近的“{% data variables.product.prodname_cli %}”选项卡。 {% endwebui %} {% vscode %} -For more information, click the "{% data variables.product.prodname_cli %}" tab near the top of this page. +有关详细信息,请单击此页面顶部附近的“{% data variables.product.prodname_cli %}”选项卡。 {% endvscode %} {% cli %} -1. Enter one of these commands to display a list of codespaces. - * `gh codespace delete --org ORGANIZATION` - Lists the current codespaces in the specified organization. - * `gh codespace delete --org ORGANIZATION --user USER` - Lists only those codespaces created by the specified user. - You must be an owner of the specified organization. -1. In the list of codespaces, navigate to the codespace you want to delete. -1. To delete the selected codespace press Enter. +1. 输入以下命令之一以显示 codespace 列表。 + * `gh codespace delete --org ORGANIZATION` - 列出指定组织中的当前 codespace。 + * `gh codespace delete --org ORGANIZATION --user USER` - 仅列出指定用户创建的 codespace。 + 你必须是指定组织的所有者。 +1. 在 codespace 列表中,导航到要删除的 codespace。 +1. 要删除选定的 codespace,请按 Enter。 - If the codespace contains unsaved changes you will be prompted to confirm deletion. + 如果 codespace 包含未保存的更改,系统会提示确认删除。 {% endcli %} -You can also use the REST API to delete codespaces for your organization. For more information, see "[Codespaces organizations](/rest/codespaces/organizations#delete-a-codespace-from-the-organization)." +还可以使用 REST API 删除组织的 codespace。 有关详细信息,请参阅“[Codespaces 组织](/rest/codespaces/organizations#delete-a-codespace-from-the-organization)”。 -## Further reading -- "[The codespace lifecycle](/codespaces/developing-in-codespaces/the-codespace-lifecycle)" -- "[Configuring automatic deletion of your codespaces](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces)" +## 延伸阅读 +- [codespace 生命周期](/codespaces/developing-in-codespaces/the-codespace-lifecycle) +- [配置 codespace 的自动删除](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces) diff --git a/translations/zh-CN/content/codespaces/developing-in-codespaces/developing-in-a-codespace.md b/translations/zh-CN/content/codespaces/developing-in-codespaces/developing-in-a-codespace.md index 0de2f28409..2457faa404 100644 --- a/translations/zh-CN/content/codespaces/developing-in-codespaces/developing-in-a-codespace.md +++ b/translations/zh-CN/content/codespaces/developing-in-codespaces/developing-in-a-codespace.md @@ -1,6 +1,6 @@ --- -title: Developing in a codespace -intro: 'You can work in a codespace using your browser, {% data variables.product.prodname_vscode %}, a JetBrains IDE, or in a command shell.' +title: 在代码空间中开发 +intro: '可以使用浏览器、{% data variables.product.prodname_vscode %}、JetBrains IDE 或在命令 shell 中在 codespace 中工作。' redirect_from: - /github/developing-online-with-github-codespaces/developing-in-a-codespace - /github/developing-online-with-codespaces/developing-in-a-codespace @@ -13,127 +13,129 @@ topics: - Fundamentals - Developer shortTitle: Develop in a codespace +ms.openlocfilehash: e941373ade8c2f8365e7b654733b7ee029a6a7dd +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159067' --- - {% jetbrains %} {% data reusables.codespaces.codespaces-jetbrains-beta-note %} {% endjetbrains %} -## About development with {% data variables.product.prodname_github_codespaces %} +## 关于使用 {% data variables.product.prodname_github_codespaces %} 进行开发 -You can develop code in a codespace using your choice of tool: +可以使用所选工具在 codespace 中开发代码: -* A command shell, via an SSH connection initiated using {% data variables.product.prodname_cli %}. -* One of the JetBrains IDEs, via the JetBrains Gateway. -* The {% data variables.product.prodname_vscode %} desktop application. -* A browser-based version of {% data variables.product.prodname_vscode %}. +* 命令 shell,通过使用 {% data variables.product.prodname_cli %} 启动的 SSH 连接。 +* JetBrains IDE 之一,通过 JetBrains 网关。 +* {% data variables.product.prodname_vscode %} 桌面应用程序。 +* {% data variables.product.prodname_vscode %} 的基于浏览器的版本。 {% webui %} -The tabs in this article allow you to switch between information for each of these ways of working. You're currently on the tab for the web browser version of {% data variables.product.prodname_vscode %}. +使用本文中的选项卡,可以在每种工作方式的信息之间切换。 你当前位于 {% data variables.product.prodname_vscode %} 的 Web 浏览器版本的选项卡上。 -## Working in a codespace in the browser +## 在浏览器的 codespace 中工作 -Using {% data variables.product.prodname_codespaces %} in the browser provides you with a fully featured development experience. You can edit code, debug, use Git commands, and run your application. +在浏览器中使用 {% data variables.product.prodname_codespaces %} 可提供功能齐全的开发体验。 可以编辑代码、调试、使用 Git 命令以及运行应用程序。 -![Annotated screenshot of a codespace in the browser](/assets/images/help/codespaces/codespace-overview-annotated.png) +![浏览器中 codespace 的带有批注的屏幕截图](/assets/images/help/codespaces/codespace-overview-annotated.png) -{% data reusables.codespaces.vscode-interface-annotation %} -{% data reusables.codespaces.use-chrome %} For more information, see "[Troubleshooting {% data variables.product.prodname_github_codespaces %} clients](/codespaces/troubleshooting/troubleshooting-github-codespaces-clients)." -{% data reusables.codespaces.developing-in-vscode %} -{% data reusables.codespaces.navigating-to-a-codespace %} +{% data reusables.codespaces.vscode-interface-annotation %} {% data reusables.codespaces.use-chrome %} 有关详细信息,请参阅“[对 {% data variables.product.prodname_github_codespaces %} 客户端进行故障排除](/codespaces/troubleshooting/troubleshooting-github-codespaces-clients)”。 +{% data reusables.codespaces.developing-in-vscode %} {% data reusables.codespaces.navigating-to-a-codespace %} {% endwebui %} {% vscode %} -The tabs in this article allow you to switch between information for each of these ways of working. You're currently on the tab for {% data variables.product.prodname_vscode %}. +使用本文中的选项卡,可以在每种工作方式的信息之间切换。 你当前位于 {% data variables.product.prodname_vscode %} 的选项卡上。 -## Working in a codespace in {% data variables.product.prodname_vscode_shortname %} +## 在 {% data variables.product.prodname_vscode_shortname %} 的 codespace 中工作 -{% data variables.product.prodname_github_codespaces %} provides you with the full development experience of {% data variables.product.prodname_vscode %}. {% data reusables.codespaces.use-visual-studio-features %} +{% data variables.product.prodname_github_codespaces %} 为你提供完整的 {% data variables.product.prodname_vscode %} 开发体验。 {% data reusables.codespaces.use-visual-studio-features %} -![Annotated screenshot of a codespace in VS Code](/assets/images/help/codespaces/codespace-annotated-vscode.png) +![VS Code 中 codespace 的带批注的屏幕截图](/assets/images/help/codespaces/codespace-annotated-vscode.png) {% data reusables.codespaces.vscode-interface-annotation %} -For more information on using {% data variables.product.prodname_vscode_shortname %}, see the [User Interface guide](https://code.visualstudio.com/docs/getstarted/userinterface) in the {% data variables.product.prodname_vscode_shortname %} documentation. +有关使用 {% data variables.product.prodname_vscode_shortname %} 的详细信息,请参阅 {% data variables.product.prodname_vscode_shortname %} 文档中的[用户界面指南](https://code.visualstudio.com/docs/getstarted/userinterface)。 {% data reusables.codespaces.connect-to-codespace-from-vscode %} -For troubleshooting information, see "[Troubleshooting Codespaces clients](/codespaces/troubleshooting/troubleshooting-github-codespaces-clients)." -{% data reusables.codespaces.developing-in-vscode %} -{% data reusables.codespaces.navigating-to-a-codespace %} +有关故障排除信息,请参阅“[对 Codespaces 客户端进行故障排除](/codespaces/troubleshooting/troubleshooting-github-codespaces-clients)”。 +{% data reusables.codespaces.developing-in-vscode %} {% data reusables.codespaces.navigating-to-a-codespace %} {% endvscode %} {% jetbrains %} -The tabs in this article allow you to switch between information for each of these ways of working. You're currently on the tab for JetBrains IDEs. +使用本文中的选项卡,可以在每种工作方式的信息之间切换。 你当前位于 JetBrains IDE 的选项卡上。 -## Working in a codespace in a JetBrains IDE +## 在 JetBrains IDE 中的 codespace 中工作 -To use {% data variables.product.prodname_github_codespaces %} with a JetBrains IDE you must have already installed JetBrains Gateway. For information about installing JetBrains Gateway, see [the JetBrains website](https://www.jetbrains.com/remote-development/gateway/). +要将 {% data variables.product.prodname_github_codespaces %} 与 JetBrains IDE 一起使用,必须已安装 JetBrains 网关。 有关安装 JetBrains 网关的信息,请参阅 [JetBrains 网站](https://www.jetbrains.com/remote-development/gateway/)。 -You can work in a codespace using your choice of JetBrains IDE. After creating a codespace, you can use the JetBrains Gateway application to open the codespace in your preferred IDE. +可以使用所选的 JetBrains IDE 在 codespace 中工作。 创建 codespace 后,可以使用 JetBrains 网关应用程序在首选 IDE 中打开 codespace。 -You can edit code, debug, and use Git commands while developing in a codespace with your JetBrains IDE. For more information about the various JetBrains IDEs, see the [JetBrains documentation](https://www.jetbrains.com/help/). +使用 JetBrains IDE 在 codespace 中进行开发时,可以编辑代码、调试和使用 Git 命令。 有关各种 JetBrains IDE 的详细信息,请参阅 [JetBrains 文档](https://www.jetbrains.com/help/)。 -### IntelliJ IDEA user interface +### IntelliJ IDEA 用户界面 -Within the {% data variables.product.prodname_github_codespaces %} documentation we use IntelliJ IDEA as a representative JetBrains IDE. Different JetBrains IDEs may have different layouts. +在 {% data variables.product.prodname_github_codespaces %} 文档中,我们使用 IntelliJ IDEA 作为具有代表性的 JetBrains IDE。 不同的 JetBrains IDE 可能具有不同的布局。 -![Annotated screenshot of a codespace in JetBrains IntelliJ IDEA](/assets/images/help/codespaces/jetbrains-gui-with-callouts.png) +![JetBrains IntelliJ IDEA 中 codespace 的带批注的屏幕截图](/assets/images/help/codespaces/jetbrains-gui-with-callouts.png) -1. **Navigation bar** - This displays the path to the currently selected file or directory. Use the buttons to the right of the navigation bar to perform various actions, including building, running, or debugging the project, or running Git commands to commit and push your changes. -2. **Project tool window** - This shows you the structure of your project and allows you to open files in the editor. -3. **{% data variables.product.prodname_github_codespaces %} tool window** - This is displayed by clicking the {% data variables.product.prodname_github_codespaces %} plugin in the bar to the left of the tool window. It displays information about your codespace, including its display name and machine type. The buttons at the top of this tool window allow you to: - * Stop the codespace and disconnect - * Display the "Your codespaces" web page - * View the codespace creation logs - * Rebuild the dev container -4. **Editor** - This is where you edit your files. You can right-click the tab for a file to access options such as moving the tab to a new window. -5. **Terminal** - This is displayed by clicking **Terminal** in the tool window bar at the bottom of the main window (just above the status bar). The integrated terminal allows you to perform command-line tasks without having to switch to a dedicated terminal application. -6. **Status bar** - Hover over the icon at the left of the status bar to see a list of tools. Click the icon to hide or show the tool window bars. The right side of the status bar shows information about the project, including the current Git branch. +1. **导航栏** - 显示当前所选文件或目录的路径。 使用导航栏右侧的按钮执行各种操作,包括生成、运行或调试项目,或者运行 Git 命令以提交和推送更改。 +2. **项目工具窗口** - 显示项目的结构,并允许在编辑器中打开文件。 +3. **{% data variables.product.prodname_github_codespaces %} 工具窗口** - 单击工具窗口左侧栏中的 {% data variables.product.prodname_github_codespaces %} 插件即可显示。 它显示有关 codespace 的信息,包括其显示名称和计算机类型。 此工具窗口顶部的按钮可用于: + * 停止 codespace 并断开连接 + * 显示“你的 codespace”网页 + * 查看 codespace 创建日志 + * 重新生成开发容器 +4. **编辑器** - 这是编辑文件的地方。 可以右键单击文件的选项卡以访问选项,例如将选项卡移动到新窗口。 +5. **终端** - 单击主窗口底部的工具窗口栏中的“终端”(状态栏正上方),即可显示。 通过集成终端,无需切换到专用终端应用程序即可执行命令行任务。 +6. **状态栏** - 将鼠标悬停在状态栏左侧的图标上可查看工具列表。 单击图标可隐藏或显示工具窗口栏。 状态栏的右侧显示有关项目的信息,包括当前 Git 分支。 -For more information about the IntelliJ IDEA user interface, see the [JetBrains documentation for IntelliJ IDEA](https://www.jetbrains.com/help/idea/guided-tour-around-the-user-interface.html). +有关 IntelliJ IDEA 用户界面的详细信息,请参阅 [IntelliJ IDEA 的 JetBrains 文档](https://www.jetbrains.com/help/idea/guided-tour-around-the-user-interface.html)。 -### Customizing the codespaces for a repository +### 自定义存储库的 codespace -You can customize the codespaces that are created for a repository by creating or updating the dev container configuration for the repository. You can do this from within a codespace. After you change a dev container configuration, you can apply the changes to the current codespace by rebuilding the Docker container for the codespace. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)." +可以通过创建或更新存储库的开发容器配置来自定义为存储库创建的 codespace。 可以从 codespace 中执行此操作。 更改开发容器配置后,可以通过为 codespace 重新生成 Docker 容器来将更改应用于当前 codespace。 有关详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)”。 -### Personalizing your codespace +### 个性化代码空间 -You can use a [dotfiles](https://dotfiles.github.io/tutorials/) repository to personalize aspects of the codespace environment for any codespace that you create. For more information, see "[Personalizing {% data variables.product.prodname_github_codespaces %} for your account](/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account#dotfiles)." +可以使用 [dotfiles](https://dotfiles.github.io/tutorials/) 存储库为创建的任何 codespace 个性化 codespace 环境的各个方面。 有关详细信息,请参阅“[为帐户设置个性化的 {% data variables.product.prodname_github_codespaces %}](/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account#dotfiles)”。 -### Committing your changes +### 提交更改 -Once you've made changes to your codespace, either new code or configuration changes, you'll want to commit and push your changes. Pushing changes to a repository ensures that anyone else who creates a codespace from this repository has the same configuration. This also means that any customization you do, to modify the configuration of codespaces created for a repository, will be available to everybody who uses the repository. +在对 codespace 进行更改(无论是添加新代码还是更改配置)之后,需要提交和推送更改。 将更改推送到存储库可确保从此存储库创建 codespace 的其他任何人都具有相同的配置。 这也意味着,为修改为存储库创建的 codespace 的配置所做的任何自定义都将可供使用该存储库的所有人使用。 -For more information, see "[Using source control in your codespace](/codespaces/developing-in-codespaces/using-source-control-in-your-codespace#committing-your-changes)." +有关详细信息,请参阅[在 codespace 中使用源代码管理](/codespaces/developing-in-codespaces/using-source-control-in-your-codespace#committing-your-changes)。 -## Further reading +## 延伸阅读 -* "[Using {% data variables.product.prodname_github_codespaces %} in your JetBrains IDE](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide)" -* "[Using the {% data variables.product.prodname_github_codespaces %} plugin for JetBrains](/codespaces/codespaces-reference/using-the-github-codespaces-plugin-for-jetbrains)" -* "[Troubleshooting {% data variables.product.prodname_github_codespaces %} clients](/codespaces/troubleshooting/troubleshooting-github-codespaces-clients)" +* “[在 JetBrains IDE 中使用 {% data variables.product.prodname_github_codespaces %}](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide)”。 +* “[将 {% data variables.product.prodname_github_codespaces %} 插件用于 JetBrains](/codespaces/codespaces-reference/using-the-github-codespaces-plugin-for-jetbrains)” +* “[对 {% data variables.product.prodname_github_codespaces %} 客户端进行故障排除](/codespaces/troubleshooting/troubleshooting-github-codespaces-clients)” {% endjetbrains %} {% cli %} -The tabs in this article allow you to switch between information for each of these ways of working. You're currently on the tab for {% data variables.product.prodname_cli %}. +使用本文中的选项卡,可以在每种工作方式的信息之间切换。 当前位于 {% data variables.product.prodname_cli %} 的选项卡上。 -## Working in a codespace in a command shell +## 在命令 shell 中的 codespace 中工作 {% data reusables.cli.cli-learn-more %} -You can use {% data variables.product.prodname_cli %} to create a new codespace, or start an existing codespace, and then SSH to it. Once connected, you can work on the command line using your preferred command-line tools. +可以使用 {% data variables.product.prodname_cli %} 创建新的 codespace,或启动现有 codespace,然后通过 SSH 连接到它。 连接后,可以使用你喜欢的命令行工具在命令行上工作。 -After installing {% data variables.product.prodname_cli %} and authenticating with your {% data variables.product.prodname_dotcom %} account you can use the command `gh codespace [...] --help` to browse the help information. Alternatively, you can view the same reference information at [https://cli.github.com/manual/gh_codespace](https://cli.github.com/manual/gh_codespace). +安装 {% data variables.product.prodname_cli %} 并对 {% data variables.product.prodname_dotcom %} 帐户进行身份验证后,可以使用命令 `gh codespace [...] --help` 浏览帮助信息。 或者,可以通过 [https://cli.github.com/manual/gh_codespace](https://cli.github.com/manual/gh_codespace) 查看相同的参考信息。 -For more information, see "[Using {% data variables.product.prodname_github_codespaces %} with GitHub CLI](/codespaces/developing-in-codespaces/using-github-codespaces-with-github-cli)." +有关详细信息,请参阅“[将 {% data variables.product.prodname_github_codespaces %} 与 GitHub CLI 结合使用](/codespaces/developing-in-codespaces/using-github-codespaces-with-github-cli)”。 {% endcli %} diff --git a/translations/zh-CN/content/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace.md b/translations/zh-CN/content/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace.md index 260ee1be7e..9aaf805236 100644 --- a/translations/zh-CN/content/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace.md +++ b/translations/zh-CN/content/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace.md @@ -1,5 +1,5 @@ --- -title: Forwarding ports in your codespace +title: 代码空间中的转发端口 intro: '{% data reusables.codespaces.about-port-forwarding %}' versions: fpt: '*' @@ -12,76 +12,77 @@ topics: - Fundamentals - Developer shortTitle: Forward ports +ms.openlocfilehash: 320a2e42d647452056961d4f0f987c3c5db49476 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158907' --- - {% jetbrains %} {% data reusables.codespaces.codespaces-jetbrains-beta-note %} {% endjetbrains %} -## About forwarded ports +## 关于转发的端口 -Port forwarding gives you access to TCP ports running within your codespace. For example, if you're running a web application on a particular port in your codespace, you can forward that port. This allows you to access the application from the browser on your local machine for testing and debugging. +通过端口转发,您可以访问在代码空间内运行的 TCP 端口。 例如,如果要在代码空间中的特定端口上运行 Web 应用程序,则可以转发该端口。 这允许您从本地计算机上的浏览器访问应用程序以进行测试和调试。 {% webui %} -{% data reusables.codespaces.port-forwarding-intro-non-jetbrains %} -{% data reusables.codespaces.navigate-to-ports-tab %} -1. Under the list of ports, click **Add port**. +{% data reusables.codespaces.port-forwarding-intro-non-jetbrains %} {% data reusables.codespaces.navigate-to-ports-tab %} +1. 在端口列表下,单击“添加端口”。 - ![Add port button](/assets/images/help/codespaces/add-port-button.png) + ![添加端口按钮](/assets/images/help/codespaces/add-port-button.png) -1. Type the port number or address, then press enter. +1. 键入端口编号或地址,然后按 Enter。 - ![Text box to type port button](/assets/images/help/codespaces/port-number-text-box.png) + ![输入端口按钮的文本框](/assets/images/help/codespaces/port-number-text-box.png) -## Using HTTPS forwarding +## 使用 HTTPS 转发 -By default, {% data variables.product.prodname_github_codespaces %} forwards ports using HTTP but you can update any port to use HTTPS, as needed. If you update a port with public visibility to use HTTPS, the port's visibility will automatically change to private. +默认情况下,{% data variables.product.prodname_github_codespaces %} 使用 HTTP 转发端口,但你可以根据需要更新任何端口以使用 HTTPS。 如果将具有公共可见性的端口更新为使用 HTTPS,则该端口的可见性将自动更改为专用。 {% data reusables.codespaces.navigate-to-ports-tab %} -1. Right click the port you want to update, then hover over **Change Port Protocol**. - ![Option to change port protocol](/assets/images/help/codespaces/update-port-protocol.png) -1. Select the protocol needed for this port. The protocol that you select will be remembered for this port for the lifetime of the codespace. +1. 右键单击要更新的端口,然后单击“更改端口协议”。 + ![更改端口协议的选项](/assets/images/help/codespaces/update-port-protocol.png) +1. 选择此端口所需的协议。 您选择的协议将在代码空间的有效期内被记住用于此端口。 {% data reusables.codespaces.port-forwarding-sharing-non-jetbrains %} {% data reusables.codespaces.navigate-to-ports-tab %} -1. Right click the port that you want to share, select the "Port Visibility" menu, then click **Private to Organization** or **Public**. - ![Option to select port visibility in right-click menu](/assets/images/help/codespaces/make-public-option.png) -1. To the right of the local address for the port, click the copy icon. - ![Copy icon for port URL](/assets/images/help/codespaces/copy-icon-port-url.png) -1. Send the copied URL to the person you want to share the port with. +1. 右键单击要共享的端口,选择“端口可见性”菜单,然后单击“专用于组织”或“公共” 。 + ![用于在右键单击菜单中选择端口可见性的选项](/assets/images/help/codespaces/make-public-option.png) +1. 在端口的本地地址右侧,单击复制图标。 + ![端口 URL 的复制图标](/assets/images/help/codespaces/copy-icon-port-url.png) +1. 将复制的 URL 发送给您想要与其共享端口的人。 -{% data reusables.codespaces.port-forwarding-labeling-non-jetbrains %} -{% data reusables.codespaces.port-forwarding-adding-non-jetbrains %} +{% data reusables.codespaces.port-forwarding-labeling-non-jetbrains %} {% data reusables.codespaces.port-forwarding-adding-non-jetbrains %} {% endwebui %} {% vscode %} -{% data reusables.codespaces.port-forwarding-intro-non-jetbrains %} -{% data reusables.codespaces.navigate-to-ports-tab %} -1. Under the list of ports, click **Add port**. +{% data reusables.codespaces.port-forwarding-intro-non-jetbrains %} {% data reusables.codespaces.navigate-to-ports-tab %} +1. 在端口列表下,单击“添加端口”。 - ![Add port button](/assets/images/help/codespaces/add-port-button.png) + ![添加端口按钮](/assets/images/help/codespaces/add-port-button.png) -1. Type the port number or address, then press enter. +1. 键入端口编号或地址,然后按 Enter。 - ![Text box to type port button](/assets/images/help/codespaces/port-number-text-box.png) + ![输入端口按钮的文本框](/assets/images/help/codespaces/port-number-text-box.png) {% data reusables.codespaces.port-forwarding-sharing-non-jetbrains %} {% data reusables.codespaces.navigate-to-ports-tab %} -1. Right click the port that you want to share, select the "Port Visibility" menu, then click **Private to Organization** or **Public**. - ![Option to make port public in right-click menu](/assets/images/help/codespaces/make-public-option.png) -1. To the right of the local address for the port, click the copy icon. - ![Copy icon for port URL](/assets/images/help/codespaces/copy-icon-port-url.png) -1. Send the copied URL to the person you want to share the port with. +1. 右键单击要共享的端口,选择“端口可见性”菜单,然后单击“专用于组织”或“公共” 。 + ![右键菜单中公开端口的选项](/assets/images/help/codespaces/make-public-option.png) +1. 在端口的本地地址右侧,单击复制图标。 + ![端口 URL 的复制图标](/assets/images/help/codespaces/copy-icon-port-url.png) +1. 将复制的 URL 发送给您想要与其共享端口的人。 -{% data reusables.codespaces.port-forwarding-labeling-non-jetbrains %} -{% data reusables.codespaces.port-forwarding-adding-non-jetbrains %} +{% data reusables.codespaces.port-forwarding-labeling-non-jetbrains %} {% data reusables.codespaces.port-forwarding-adding-non-jetbrains %} {% endvscode %} @@ -90,37 +91,37 @@ By default, {% data variables.product.prodname_github_codespaces %} forwards por {% data reusables.cli.cli-learn-more %} -To forward a port use the `gh codespace ports forward` subcommand. Replace `codespace-port:local-port` with the remote and local ports that you want to connect. After entering the command choose from the list of codespaces that's displayed. +若要转发端口,请使用 `gh codespace ports forward` 子命令。 将 `codespace-port:local-port` 替换为要连接的远程端口和本地端口。 输入命令后,从显示的代码空间列表中进行选择。 ```shell gh codespace ports forward CODESPACE-PORT:LOCAL-PORT ``` -For more information about this command, see [the {% data variables.product.prodname_cli %} manual](https://cli.github.com/manual/gh_codespace_ports_forward). +有关此命令的详细信息,请参阅 [{% data variables.product.prodname_cli %} 手册](https://cli.github.com/manual/gh_codespace_ports_forward)。 -To see details of forwarded ports enter `gh codespace ports` and then choose a codespace. +若要查看转发端口的详细信息,请输入 `gh codespace ports` 并选择 codespace。 {% data reusables.codespaces.port-forwarding-sharing-non-jetbrains %} -To change the visibility of a forwarded port, use the `gh codespace ports visibility` subcommand. {% data reusables.codespaces.port-visibility-settings %} +若要更改转发端口的可见性,请使用 `gh codespace ports visibility` 子命令。 {% data reusables.codespaces.port-visibility-settings %} -Replace `codespace-port` with the forwarded port number. Replace `setting` with `private`, `org`, or `public`. After entering the command choose from the list of codespaces that's displayed. +将 `codespace-port` 替换为转发的端口号。 将 `setting` 替换为 `private`、`org` 或 `public`。 输入命令后,从显示的代码空间列表中进行选择。 ```shell gh codespace ports visibility CODESPACE-PORT:SETTINGS ``` -You can set the visibility for multiple ports with one command. For example: +您可以使用一个命令设置多个端口的可见性。 例如: ```shell gh codespace ports visibility 80:private 3000:public 3306:org ``` -For more information about this command, see [the {% data variables.product.prodname_cli %} manual](https://cli.github.com/manual/gh_codespace_ports_visibility). +有关此命令的详细信息,请参阅 [{% data variables.product.prodname_cli %} 手册](https://cli.github.com/manual/gh_codespace_ports_visibility)。 {% data reusables.codespaces.port-forwarding-labeling-non-jetbrains %} -You can see the port labels when you list the forwarded ports for a codespace. To do this, use the `gh codespace ports` command and then select a codespace. +列出 codespace 的转发端口时,可以看到端口标签。 为此,请使用 `gh codespace ports` 命令,然后选择 codespace。 {% data reusables.codespaces.port-forwarding-adding-non-jetbrains %} @@ -128,10 +129,10 @@ You can see the port labels when you list the forwarded ports for a codespace. T {% jetbrains %} -## Forwarding a port +## 转发端口 -For information on how to forward a port in a codespace to a port on your local machine, see the "Port forwarding" section of the "[Security model](https://www.jetbrains.com/help/idea/security-model.html#port_forwarding)" article in the JetBrains documentation. +若要了解如何将 codespace 中的端口转发到本地计算机上的端口的信息,请参阅 JetBrains 文档中“[安全模型](https://www.jetbrains.com/help/idea/security-model.html#port_forwarding)”一文的“端口转发”部分。 -Alternatively, you can use {% data variables.product.prodname_cli %} to forward a port. For more information, click the "{% data variables.product.prodname_cli %}" tab at the top of this page. +或者,可以使用 {% data variables.product.prodname_cli %} 转发端口。 有关详细信息,请单击此页面顶部附近的“{% data variables.product.prodname_cli %}”选项卡。 {% endjetbrains %} diff --git a/translations/zh-CN/content/codespaces/developing-in-codespaces/getting-started-with-github-codespaces-for-machine-learning.md b/translations/zh-CN/content/codespaces/developing-in-codespaces/getting-started-with-github-codespaces-for-machine-learning.md new file mode 100644 index 0000000000..cbeaf83bc7 --- /dev/null +++ b/translations/zh-CN/content/codespaces/developing-in-codespaces/getting-started-with-github-codespaces-for-machine-learning.md @@ -0,0 +1,108 @@ +--- +title: 用于机器学习的 GitHub Codespaces 入门 +shortTitle: Machine learning +intro: '了解如何使用 {% data variables.product.prodname_github_codespaces %} 及其现成工具处理机器学习项目。' +versions: + fpt: '*' + ghec: '*' +type: tutorial +topics: + - Codespaces + - Developer +ms.openlocfilehash: 905d5b14bfba5e47d1fdfdd7f0be75b16750652d +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158915' +--- +## 简介 + +本指南介绍使用 {% data variables.product.prodname_github_codespaces %} 进行机器学习。 你将生成简单的图像分类器,了解 {% data variables.product.prodname_github_codespaces %} 中预安装的一些工具,为 NVIDIA CUDA 配置开发环境,并在 JupyterLab 中打开 codespace。 + +## 生成简单的图像分类器 + +我们将使用 Jupyter 笔记本生成简单的图像分类器。 + +Jupyter 笔记本是一组可以逐个执行的单元。 我们将使用的笔记本包括许多单元,它们使用 [PyTorch](https://pytorch.org/) 生成图像分类器。 每个单元都是该过程的不同阶段:下载数据集,设置神经网络,训练模型,然后测试该模型。 + +我们将按顺序运行所有单元,以执行生成图像分类器的所有阶段。 当我们执行此操作时,Jupyter 会将输出保存回笔记本,以便可以检查结果。 + +### 创建 codespace + +1. 转到 [github/codespaces-jupyter](https://github.com/github/codespaces-jupyter) 模板存储库。 +{% data reusables.codespaces.open-template-in-codespace-step %} + +此模板的 codespace 会在基于 Web 的 {% data variables.product.prodname_vscode %} 版本中打开。 + +### 打开图像分类器笔记本 + +{% data variables.product.prodname_github_codespaces %} 使用的默认容器映像包括一组预安装在 codespace 中的机器学习库。 例如,Numpy、pandas、SciPy、Matplotlib、seaborn、scikit-learn、Keras、PyTorch、Requests 和 Plotly。 有关默认映像的详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#using-the-default-dev-container-configuration)”和 [`devcontainers/images` 存储库](https://github.com/devcontainers/images/tree/main/src/universal)。 + +1. 在 {% data variables.product.prodname_vscode_shortname %} 编辑器中,关闭显示的任何“入门”选项卡。 +1. 打开 `notebooks/image-classifier.ipynb` 笔记本文件。 + +### 生成图像分类器 + +图像分类器笔记本包含下载数据集、训练神经网络以及评估其性能所需的所有代码。 + +1. 单击“全部运行”以执行所有笔记本单元。 + + ![“全部运行”按钮的屏幕截图](/assets/images/help/codespaces/jupyter-run-all.png) + +1. 向下滚动以查看每个单元的输出。 + + ![编辑器中步骤 3 的屏幕截图](/assets/images/help/codespaces/jupyter-notebook-step3.png) + +## 为 codespace 配置 NVIDIA CUDA + +某些软件要求安装 NVIDIA CUDA 才能使用 codespace 的 GPU。 在这种情况下,可以使用 `devcontainer.json` 文件创建自己的自定义配置,并指定应安装 CUDA。 有关创建自定义配置的详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#creating-a-custom-dev-container-configuration)”。 + +{% note %} + +注意:有关在添加 `nvidia-cuda` 功能时运行的脚本的完整详细信息,请参阅 [devcontainers/features 存储库](https://github.com/devcontainers/features/tree/main/src/nvidia-cuda)。 + +{% endnote %} + +1. 在 cpdespace 内的编辑器中打开 `.devcontainer/devcontainer.json` 文件。 +1. 添加包含以下内容的顶级 `features` 对象: + + ```json{:copy} + "features": { + "ghcr.io/devcontainers/features/nvidia-cuda:1": { + "installCudnn": true + } + } + ``` + + 有关 `features` 对象的详细信息,请参阅[开发容器规范](https://containers.dev/implementors/features/#devcontainer-json-properties)。 + + 如果使用为本教程创建的图像分类器存储库中的 `devcontainer.json` 文件,则 `devcontainer.json` 文件现在会如下所示: + + ```json + { + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "ms-toolsai.jupyter" + ] + } + }, + "features": { + "ghcr.io/devcontainers/features/nvidia-cuda:1": { + "installCudnn": true + } + } + } + ``` + +1. 保存更改。 +{% data reusables.codespaces.rebuild-command %}将重新生成 codespace 容器。 这需要几分钟。 重新生成完成后,codespace 会自动重新打开。 +1. 将更改发布到存储库,以便在将来从此存储库创建的任何新 codespace 中安装 CUDA。 有关详细信息,请参阅“[通过模板创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template#publishing-from-vs-code)”。 + +## 在 JupyterLab 中打开 codespace + +可以在 JupyterLab ([github.com/codespaces](https://github.com/codespaces)) 的“你的 codespace”页或使用 {% data variables.product.prodname_cli %} 打开 codespace。 有关详细信息,请参阅“[打开现有 codespace](/codespaces/developing-in-codespaces/opening-an-existing-codespace)”。 + +{% data reusables.codespaces.jupyterlab-installed-in-codespace %} diff --git a/translations/zh-CN/content/codespaces/developing-in-codespaces/opening-an-existing-codespace.md b/translations/zh-CN/content/codespaces/developing-in-codespaces/opening-an-existing-codespace.md index cc463fbc81..a0a418e4d4 100644 --- a/translations/zh-CN/content/codespaces/developing-in-codespaces/opening-an-existing-codespace.md +++ b/translations/zh-CN/content/codespaces/developing-in-codespaces/opening-an-existing-codespace.md @@ -1,6 +1,6 @@ --- -title: Opening an existing codespace -intro: 'You can reopen a codespace that you have closed or stopped and return to your work.' +title: 打开现有 codespace +intro: 可以重新打开已关闭或已停止的 codespace 并返回到工作。 versions: fpt: '*' ghec: '*' @@ -10,46 +10,51 @@ topics: - Fundamentals - Developer shortTitle: Open an existing codespace +ms.openlocfilehash: e7a35c1a7b3a251094bf69fcd401291b69d03eae +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159003' --- - {% jetbrains %} {% data reusables.codespaces.codespaces-jetbrains-beta-note %} {% endjetbrains %} -You can reopen any of your active or stopped codespaces on {% data variables.product.prodname_dotcom_the_website %}, in a JetBrains IDE, in {% data variables.product.prodname_vscode %}, or by using {% data variables.product.prodname_cli %}. You can't reopen a codespace that has been deleted. For more information, see "[The codespace lifecycle](/codespaces/developing-in-codespaces/the-codespace-lifecycle)." +您可以在 {% data variables.product.prodname_dotcom_the_website %}、JetBrains IDE 中、{% data variables.product.prodname_vscode %} 中或使用 {% data variables.product.prodname_cli %} 重新打开任何活动或已停止的代码空间。 无法重新打开已删除的 codespace。 有关详细信息,请参阅“[codespace 生命周期](/codespaces/developing-in-codespaces/the-codespace-lifecycle)”。 -You can view all your codespaces on the "Your codespaces" page at [github.com/codespaces](https://github.com/codespaces). From this page, you can: +可以在“你的 codespace”页 ([github.com/codespaces](https://github.com/codespaces)) 上查看所有 codespace。 在此页中,可以: -- Open, stop, or delete your codespaces. -- See who owns (and may be billed for) your codespaces: your personal account, or organizations you belong to. For more information, see "[About billing for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)." -- Create a new codespace, either by choosing one of {% data variables.product.company_short %}'s templates or by clicking **New codespace**. For more information, see "[Creating a codespace from a template](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template)" and "[Creating a codespace for a repository](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository)." +- 打开、停止或删除 codespace。 +- 了解谁拥有 codespace(并可能为 codespace 付费):你的个人帐户或你所属的组织。 有关详细信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)”。 +- 通过选择 {% data variables.product.company_short %} 模板之一或单击“新建 codespace”来创建新的 codespace。 有关详细信息,请参阅“[从模板创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template)”和“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository)”。 -## Opening an existing codespace +## 打开现有 codespace {% webui %} {% data reusables.codespaces.your-codespaces-procedure-step %} -1. To open a codespace in your default editor, click the name of the codespace. {% data reusables.codespaces.about-changing-default-editor %} For more information, see "[Setting your default editor for {% data variables.product.prodname_github_codespaces %}](/codespaces/customizing-your-codespace/setting-your-default-editor-for-github-codespaces)." +1. 要在默认编辑器中打开 codespace,请单击 codespace 的名称。 {% data reusables.codespaces.about-changing-default-editor %}有关详细信息,请参阅“[设置 {% data variables.product.prodname_github_codespaces %} 的默认编辑器](/codespaces/customizing-your-codespace/setting-your-default-editor-for-github-codespaces)”。 - To open the codespace in an editor other than your default: + 如需从非默认编辑器中打开 codespace,请执行以下操作: - 1. Click the ellipsis (**...**) to the right of the codespace you want to open. - 1. Click **Open in**. - 1. Click **Open in APPLICATION**. + 1. 单击要打开的 codespace 右侧的省略号 (...)。 + 1. 单击“在...中打开”。 + 1. 单击“在应用程序中打开”。 - ![Screenshot of the "Open in" dialog box, with "Open in Visual Studio Code" highlighted](/assets/images/help/codespaces/open-codespace-in-another-editor.png) + ![“在...中打开”对话框的屏幕截图,其中突出显示“在 Visual Studio Code 中打开”](/assets/images/help/codespaces/open-codespace-in-another-editor.png) - You can open the codespace in: - * Your browser + 可以在以下项中打开 codespace: + * 浏览器 * {% data variables.product.prodname_vscode %} - * JetBrains Gateway + * JetBrains 网关 * JupyterLab {% data reusables.codespaces.application-installed-locally %} - If you choose **JupyterLab**, the JupyterLab application must be installed in the codespace. {% data reusables.codespaces.jupyterlab-in-default-image %} + 如果选择“JupyterLab”,则必须在 codespace 中安装 JupyterLab 应用程序。 {% data reusables.codespaces.jupyterlab-in-default-image %} {% endwebui %} @@ -57,29 +62,28 @@ You can view all your codespaces on the "Your codespaces" page at [github.com/co {% note %} -**Note:** {% data reusables.codespaces.using-codespaces-in-vscode %} For more information, see "[Using {% data variables.product.prodname_github_codespaces %} in {% data variables.product.prodname_vscode %}](/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code)." +注意:{% data reusables.codespaces.using-codespaces-in-vscode %}有关详细信息,请参阅“[在 {% data variables.product.prodname_vscode %} 中使用 {% data variables.product.prodname_github_codespaces %}](/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code)”。 {% endnote %} -1. In the {% data variables.product.prodname_vscode_shortname %} desktop application, open the Command Palette with Command+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux). -1. Type "Codespaces" and select one of the following commands. - - To open a codespace in a new window of {% data variables.product.prodname_vscode_shortname %}, select **Codespaces: Open Codespace in New Window** - - To open a codespace in the web editor, select **Codespaces: Open in Browser** -1. Click the codespace that you want to open. +1. 在 {% data variables.product.prodname_vscode_shortname %} 桌面应用程序中,使用 Command+Shift+P (Mac) 或 Ctrl+Shift+P (Windows/Linux) 打开命令面板。 +1. 键入“Codespaces”并选择以下命令之一。 + - 要在 {% data variables.product.prodname_vscode_shortname %} 的新窗口中打开 codespace,请选择“Codespaces: 在新窗口中打开 Codespace” + - 要在 Web 编辑器中打开 codespace,请选择“Codespaces: 在浏览器中打开” +1. 单击要打开的 codespace。 - ![Screenshot of a list of codespaces in Visual Studio Code](/assets/images/help/codespaces/open-codespace-from-vscode.png) + ![Visual Studio Code 中 codespace 列表的屏幕截图](/assets/images/help/codespaces/open-codespace-from-vscode.png) -You can also access the commands listed above by navigating to the Remote Explorer view in {% data variables.product.prodname_vscode_shortname %} and right-clicking the codespace that you want to open. +还可通过导航到 {% data variables.product.prodname_vscode_shortname %} 中的“远程资源管理器”视图并右键单击要打开的 codespace 来访问上面列出的命令。 -![Screenshot of a codespace selected in the Remote Explorer, with "Open in Browser" highlighted](/assets/images/help/codespaces/open-codespace-remote-explorer.png) +![在“远程资源管理器”中选择的 codespace 的屏幕截图,其中突出显示了“在浏览器中打开”](/assets/images/help/codespaces/open-codespace-remote-explorer.png) -{% data reusables.codespaces.remote-explorer %} -{% endvscode %} +{% data reusables.codespaces.remote-explorer %} {% endvscode %} {% cli %} -1. In a terminal, enter one of the following {% data variables.product.prodname_cli %} commands. - - To open a codespace in {% data variables.product.prodname_vscode_shortname %}, enter: +1. 在终端中,输入以下 {% data variables.product.prodname_cli %} 命令之一。 + - 若要在 {% data variables.product.prodname_vscode_shortname %} 中删除 codespace,请输入: ```shell{:copy} gh codespace code @@ -87,17 +91,17 @@ You can also access the commands listed above by navigating to the Remote Explor {% note %} - **Note**: You must have {% data variables.product.prodname_vscode_shortname %} installed on your local machine. For more information, see "[Setting up Visual Studio Code](https://code.visualstudio.com/docs/setup/setup-overview)" in the {% data variables.product.prodname_vscode_shortname %} documentation. + 注意:必须在本地计算机上安装 {% data variables.product.prodname_vscode_shortname %}。 有关详细信息,请参阅 {% data variables.product.prodname_vscode_shortname %} 文档中的“[设置 Visual Studio Code](https://code.visualstudio.com/docs/setup/setup-overview)”。 {% endnote %} - - To open a codespace in the browser, enter: + - 若要在浏览器中打开 codespace,请输入: ```shell{:copy} gh codespace code --web ``` - - To open a codespace in JupyterLab, enter: + - 要在 JupyterLab 中打开 codespace,请输入: ```shell{:copy} gh codespace code --jupyter @@ -105,14 +109,14 @@ You can also access the commands listed above by navigating to the Remote Explor {% note %} - **Note**: {% data reusables.codespaces.jupyterlab-installed-in-codespace %} + 注意:{% data reusables.codespaces.jupyterlab-installed-in-codespace %} {% endnote %} -1. Using the arrow keys, navigate to the codespace that you want to open. -1. To open the codespace, press Enter. +1. 使用箭头键导航到要打开的 codespace。 +1. 若要打开 codespace,请按 Enter。 -For more information, see [`gh codespace code`](https://cli.github.com/manual/gh_codespace_code) in the {% data variables.product.prodname_cli %} manual. +有关详细信息,请参阅 {% data variables.product.prodname_cli %} 手册中的 [`gh codespace code`](https://cli.github.com/manual/gh_codespace_code)。 {% endcli %} @@ -120,4 +124,4 @@ For more information, see [`gh codespace code`](https://cli.github.com/manual/gh {% data reusables.codespaces.opening-codespace-in-jetbrains %} -{% endjetbrains %} \ No newline at end of file +{% endjetbrains %} diff --git a/translations/zh-CN/content/codespaces/developing-in-codespaces/stopping-and-starting-a-codespace.md b/translations/zh-CN/content/codespaces/developing-in-codespaces/stopping-and-starting-a-codespace.md index 879021588c..f027c8c1e7 100644 --- a/translations/zh-CN/content/codespaces/developing-in-codespaces/stopping-and-starting-a-codespace.md +++ b/translations/zh-CN/content/codespaces/developing-in-codespaces/stopping-and-starting-a-codespace.md @@ -1,6 +1,6 @@ --- -title: Stopping and starting a codespace -intro: 'You can stop and start your codespace to save resources and to pause work.' +title: 停止和启动 codespace +intro: 可停止和启动 codespace 以保存资源和暂停工作。 versions: fpt: '*' ghec: '*' @@ -10,28 +10,33 @@ topics: - Fundamentals - Developer shortTitle: Stop a codespace +ms.openlocfilehash: 290a39d9d60420230bd9b11d5e2d10119ccc1c72 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158803' --- - {% jetbrains %} {% data reusables.codespaces.codespaces-jetbrains-beta-note %} {% endjetbrains %} -## About stopping and starting a codespace +## 关于停止和启动 codespace {% data reusables.codespaces.stopping-a-codespace %} -Regardless of where you created or access your codespaces, you can view and manage them in your browser at https://github.com/codespaces. +无论在何处创建或访问 codespace,都可以通过浏览器在 https://github.com/codespaces 中查看和管理它们。 -## Stopping a codespace +## 停止代码空间 {% webui %} {% data reusables.codespaces.navigate-to-codespaces-page %} - 1. To the right of the codespace you want to stop, click the elipsis (**...**). - 1. Click **Stop codespace**. - ![Screenshot of option to stop a codespace](/assets/images/help/codespaces/stop-codespace-webui.png) + 1. 单击要停止的 codespace 右侧的省略号 (...)。 + 1. 单击“停止 codespace”。 + ![用于停止 codespace 的选项的屏幕截图](/assets/images/help/codespaces/stop-codespace-webui.png) {% endwebui %} @@ -39,7 +44,7 @@ Regardless of where you created or access your codespaces, you can view and mana {% data reusables.cli.cli-learn-more %} - To stop a codespace use the `gh codespace stop` subcommand and then choose the codespace you want to stop from the list that's displayed. + 要停止 codespace,请使用 `gh codespace stop` 子命令,然后从显示的列表中选择该 codespace。 ```shell{:copy} gh codespace stop @@ -50,41 +55,41 @@ Regardless of where you created or access your codespaces, you can view and mana {% vscode %} {% data reusables.vs-code.open-command-palette %} -1. Type `stop` and select **Codespaces: Stop Codespace** from the list of options. -1. In the list of codespaces, select the codespace you want to stop. +1. 键入 `stop` 并从选项列表中选择“Codespaces: 停止 Codespace”。 +1. 在 codespace 列表中,选择要停止的 codespace。 {% endvscode %} {% jetbrains %} {% data reusables.codespaces.jetbrains-open-codespace-plugin %} -1. In the {% data variables.product.prodname_github_codespaces %} tool window, click the stop icon. +1. 在 {% data variables.product.prodname_github_codespaces %} 工具窗口中,单击“停止”图标。 - ![Screenshot of the log button](/assets/images/help/codespaces/jetbrains-plugin-icon-stop.png) + ![“日志”按钮的屏幕截图](/assets/images/help/codespaces/jetbrains-plugin-icon-stop.png) {% endjetbrains %} -## Restarting a codespace +## 重启 codespace {% webui %} {% data reusables.codespaces.navigate-to-codespaces-page %} -1. Click the name of the codespace you want to restart. -![Screenshot of stopped codespaces](/assets/images/help/codespaces/restart-codespace-webui.png) +1. 单击要重启的 codespace 的名称。 +![已停止的 codespace 的屏幕截图](/assets/images/help/codespaces/restart-codespace-webui.png) {% endwebui %} {% cli %} -When you restart a codespace you can choose to open it in {% data variables.product.prodname_vscode %} or in your browser. +重启 codespace 时,可选择在 {% data variables.product.prodname_vscode %} 或浏览器中将其打开。 - - To restart a codespace and open it in {% data variables.product.prodname_vscode %}, use the `gh codespace code` subcommand and then choose the codespace you want to restart from the list that's displayed. + - 要重启 codespace 并在 {% data variables.product.prodname_vscode %} 中将其打开,请使用 `gh codespace code` 子命令,然后从显示的列表中选择要重启的 codespace。 ```shell{:copy} gh codespace code ``` - - To restart a codespace and open it in your browser, use the `gh codespace open --web` subcommand and then choose the codespace you want to restart from the list that's displayed. + - 要重启 codespace 并在浏览器中将其打开,请使用 `gh codespace open --web` 子命令,然后从显示的列表中选择要重启的 codespace。 ```shell{:copy} gh codespace open --web @@ -95,8 +100,8 @@ When you restart a codespace you can choose to open it in {% data variables.prod {% vscode %} {% data reusables.vs-code.open-command-palette %} -1. Type `connect` and select **Codespaces: Connect to Codespace** from the list of options. -1. In the list of codespaces, select the codespace you want to restart. +1. 键入 `connect` 并从选项列表中选择“Codespaces: 连接到 Codespace”。 +1. 在 codespace 列表中,选择要重启的 codespace。 {% endvscode %} @@ -106,6 +111,6 @@ When you restart a codespace you can choose to open it in {% data variables.prod {% endjetbrains %} -## Further reading +## 延伸阅读 -- "[The codespace lifecycle](/codespaces/developing-in-codespaces/the-codespace-lifecycle)" +- [codespace 生命周期](/codespaces/developing-in-codespaces/the-codespace-lifecycle) diff --git a/translations/zh-CN/content/codespaces/developing-in-codespaces/the-codespace-lifecycle.md b/translations/zh-CN/content/codespaces/developing-in-codespaces/the-codespace-lifecycle.md new file mode 100644 index 0000000000..1d1af74da9 --- /dev/null +++ b/translations/zh-CN/content/codespaces/developing-in-codespaces/the-codespace-lifecycle.md @@ -0,0 +1,67 @@ +--- +title: The codespace lifecycle +intro: 'You can develop in a {% data variables.product.prodname_github_codespaces %} environment and maintain your data throughout the entire codespace lifecycle.' +versions: + fpt: '*' + ghec: '*' +type: overview +topics: + - Codespaces + - Developer +redirect_from: + - /codespaces/developing-in-codespaces/codespaces-lifecycle +--- + +## About the lifecycle of a codespace + +The lifecycle of a codespace begins when you create a codespace and ends when you delete it. You can disconnect and reconnect to an active codespace without affecting its running processes. You may stop and restart a codespace without losing changes that you have made to your project. + +## Creating a codespace + +When you want to work on a project, you can choose to create a new codespace or open an existing codespace. You might want to create a new codespace from a branch of your repository each time you develop in {% data variables.product.prodname_github_codespaces %} or keep a long-running codespace for a feature. {% data reusables.codespaces.starting-new-project-template %} For more information, see "[Creating a codespace for a repository](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository)" and "[Creating a codespace from a template](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template)." + +{% data reusables.codespaces.max-number-codespaces %} Similarly, if you reach the maximum number of active codespaces and you try to start another, you are prompted to stop one of your active codespaces. + +If you choose to create a new codespace each time you work on a project, you should regularly push your changes so that any new commits are on {% data variables.product.prodname_dotcom %}. If you choose to use a long-running codespace for your project, you should pull from your repository's default branch each time you start working in your codespace so that your environment has the latest commits. This workflow is very similar to if you were working with a project on your local machine. + +{% data reusables.codespaces.prebuilds-crossreference %} + +## Saving changes in a codespace + +When you connect to a codespace through the web, auto-save is enabled automatically for the web editor and configured to save changes after a delay. When you connect to a codespace through {% data variables.product.prodname_vscode %} running on your desktop, you must enable auto-save. For more information, see [Save/Auto Save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) in the {% data variables.product.prodname_vscode %} documentation. + +Your work will be saved on a virtual machine in the cloud. You can close and stop a codespace and return to the saved work later. If you have unsaved changes, your editor will prompt you to save them before exiting. However, if your codespace is deleted, then your work will be deleted too. To persist your work, you will need to commit your changes and push them to your remote repository, or publish your work to a new remote repository if you created your codespace from a template. For more information, see "[Using source control in your codespace](/codespaces/developing-in-codespaces/using-source-control-in-your-codespace)." + +## Timeouts for {% data variables.product.prodname_github_codespaces %} + +If you leave your codespace running without interaction, or if you exit your codespace without explicitly stopping it, the codespace will timeout after a period of inactivity and stop running. By default, a codespace will timeout after 30 minutes of inactivity, but you can customize the duration of the timeout period for new codespaces that you create. For more information about setting the default timeout period for your codespaces, see "[Setting your timeout period for {% data variables.product.prodname_github_codespaces %}](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-github-codespaces)." For more information about stopping a codespace, see "[Stopping a codespace](#stopping-a-codespace)." + +When a codespace times out, your data is preserved from the last time your changes were saved. For more information, see "[Saving changes in a codespace](#saving-changes-in-a-codespace)." + +## Rebuilding a codespace + +You can rebuild your codespace to implement changes to your dev container configuration. For most uses, you can create a new codespace as an alternative to rebuilding a codespace. By default, when you rebuild your codespace, {% data variables.product.prodname_github_codespaces %} will reuse images from your cache to speed up the rebuild process. Alternatively, you can perform a full rebuild, which clears your cache and rebuilds the container with fresh images. + +For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#applying-configuration-changes-to-a-codespace)" and "[Performing a full rebuild of a container](/codespaces/codespaces-reference/performing-a-full-rebuild-of-a-container)." + +## Stopping a codespace + +{% data reusables.codespaces.stopping-a-codespace %} For more information, see "[Stopping and starting a codespace](/codespaces/developing-in-codespaces/stopping-and-starting-a-codespace)." + +## Deleting a codespace + +You can create a codespace for a particular task and then safely delete the codespace after you push your changes to a remote branch. + +If you try to delete a codespace with unpushed git commits, your editor will notify you that you have changes that have not been pushed to a remote branch. You can push any desired changes and then delete your codespace, or continue to delete your codespace and any uncommitted changes. You can also export your code to a new branch without creating a new codespace. For more information, see "[Exporting changes to a branch](/codespaces/troubleshooting/exporting-changes-to-a-branch)." + +Codespaces that have been stopped and remain inactive for a specified period of time will be deleted automatically. By default, inactive codespaces are deleted after 30 days, but you can customize your codespace retention period. For more information, see "[Configuring automatic deletion of your codespaces](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces)." + +If you create a codespace, it will continue to accrue storage charges until it is deleted, irrespective of whether it is active or stopped. For more information, see "[About billing for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#billing-for-storage-usage)." Deleting a codespace does not reduce the current billable amount for {% data variables.product.prodname_github_codespaces %}, which accumulates during each monthly billing cycle. For more information, see "[Viewing your {% data variables.product.prodname_github_codespaces %} usage](/billing/managing-billing-for-github-codespaces/viewing-your-github-codespaces-usage)." + +For more information on deleting a codespace, see "[Deleting a codespace](/codespaces/developing-in-codespaces/deleting-a-codespace)." + +## Losing the connection while using {% data variables.product.prodname_github_codespaces %} + +{% data variables.product.prodname_github_codespaces %} is a cloud-based development environment and requires an internet connection. If you lose connection to the internet while working in a codespace, you will not be able to access your codespace. However, any uncommitted changes will be saved. When you have access to an internet connection again, you can connect to your codespace in the exact same state that it was left in. If you have an unstable internet connection, you should commit and push your changes often. + +If you know that you will often be working offline, you can use your `devcontainer.json` file with the ["Dev Containers" extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) for {% data variables.product.prodname_vscode_shortname %} to build and attach to a local development container for your repository. For more information, see [Developing inside a container](https://code.visualstudio.com/docs/remote/containers) in the {% data variables.product.prodname_vscode %} documentation. diff --git a/translations/zh-CN/content/codespaces/developing-in-codespaces/using-github-codespaces-for-pull-requests.md b/translations/zh-CN/content/codespaces/developing-in-codespaces/using-github-codespaces-for-pull-requests.md index ef83a33004..8d2bff67d5 100644 --- a/translations/zh-CN/content/codespaces/developing-in-codespaces/using-github-codespaces-for-pull-requests.md +++ b/translations/zh-CN/content/codespaces/developing-in-codespaces/using-github-codespaces-for-pull-requests.md @@ -1,7 +1,7 @@ --- -title: Using GitHub Codespaces for pull requests +title: 将 GitHub Codespaces 用于拉取请求 shortTitle: Pull requests -intro: 'You can use {% data variables.product.prodname_github_codespaces %} in your web browser, or in {% data variables.product.prodname_vscode %} to create pull requests, review pull requests, and address review comments.' +intro: '你可以在 Web 浏览器中或 {% data variables.product.prodname_vscode %} 中使用 {% data variables.product.prodname_github_codespaces %} 来创建拉取请求、审阅拉取请求和处理审阅注释。' versions: fpt: '*' ghec: '*' @@ -12,47 +12,52 @@ topics: - Developer redirect_from: - /codespaces/developing-in-codespaces/using-codespaces-for-pull-requests +ms.openlocfilehash: 6932f8eb9095987bfe808080983970c8807b6d93 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159462' --- +## 关于 {% data variables.product.prodname_github_codespaces %} 中的拉取请求 -## About pull requests in {% data variables.product.prodname_github_codespaces %} +{% data variables.product.prodname_github_codespaces %} 为你提供了处理拉取请求可能需要的许多功能: -{% data variables.product.prodname_github_codespaces %} provides you with many of the capabilities you might need to work with pull requests: +- [创建拉取请求](/codespaces/developing-in-codespaces/using-source-control-in-your-codespace#raising-a-pull-request) - 使用终端和 Git 命令或源代码管理视图,可以像在 {% data variables.product.prodname_dotcom_the_website %} 上一样创建拉取请求。 如果存储库使用拉取请求模板,则可以在源代码管理视图中使用它。 +- [打开拉取请求](#opening-a-pull-request-in-codespaces) - 可以在代码空间中打开现有拉取请求,前提是你对要合并的分支具有代码空间访问权限。 +- [审查拉取请求](#reviewing-a-pull-request-in-codespaces) - 在代码空间中打开拉取请求后,可以使用“GitHub 拉取请求”视图添加审查评论和批准拉取请求。 还可以使用 {% data variables.product.prodname_github_codespaces %} 来[查看审阅注释](#view-comments-from-a-review-in-codespaces)。 -- [Create a pull request](/codespaces/developing-in-codespaces/using-source-control-in-your-codespace#raising-a-pull-request) - Using either the Terminal and Git commands or the Source Control view, you can create pull requests just as you would on {% data variables.product.prodname_dotcom_the_website %}. If the repository uses a pull request template, you'll be able to use this within the Source Control view. -- [Open a pull request](#opening-a-pull-request-in-codespaces) – You can open an existing pull request in a codespace, provided you have codespace access to the branch that is being merged in. -- [Review a pull request](#reviewing-a-pull-request-in-codespaces) - Once you have opened a pull request in a codespace, you can use the "GitHub Pull Request" view to add review comments and approve pull requests. You can also use {% data variables.product.prodname_github_codespaces %} to [view review comments](#view-comments-from-a-review-in-codespaces). - -## Opening a pull request in {% data variables.product.prodname_codespaces %} +## 在 {% data variables.product.prodname_codespaces %} 中打开拉取请求 {% data reusables.repositories.sidebar-pr %} -1. In the list of pull requests, click the pull request you'd like to open in {% data variables.product.prodname_codespaces %}. -1. On the right-hand side of your screen, click **{% octicon "code" aria-label="The code icon" %} Code**. -1. In the {% data variables.product.prodname_codespaces %} tab, click the plus sign ({% octicon "plus" aria-label="The plus icon" %}) +1. 在拉取请求列表中,单击要在 {% data variables.product.prodname_codespaces %} 中打开的拉取请求。 +1. 在屏幕右侧,单击“{% octicon "code" aria-label="The code icon" %} 代码”。 +1. 在 {% data variables.product.prodname_codespaces %} 选项卡中,单击加号 ({% octicon "plus" aria-label="The plus icon" %}) - ![Option to open PR in a codespace](/assets/images/help/codespaces/open-with-codespaces-pr.png) + ![用于在代码空间中打开 PR 的选项](/assets/images/help/codespaces/open-with-codespaces-pr.png) - A codespace is created for the pull request branch and is opened in your default editor for {% data variables.product.prodname_github_codespaces %}. + 为拉取请求分支创建 codespace,并在 {% data variables.product.prodname_github_codespaces %} 的默认编辑器中打开。 -## Reviewing a pull request in {% data variables.product.prodname_codespaces %} +## 在 {% data variables.product.prodname_codespaces %} 中审阅拉取请求 -1. With your default editor set to either {% data variables.product.prodname_vscode %} or {% data variables.product.prodname_vscode %} for Web, open the pull request in a codespace, as described in "[Opening a pull request](/codespaces/developing-in-codespaces/using-codespaces-for-pull-requests#opening-a-pull-request-in-codespaces)" above. -2. In the Activity Bar, click the **GitHub Pull Request** view. This view only appears when you open a pull request in a codespace. - ![Option to open PR in a codespace](/assets/images/help/codespaces/github-pr-view.png) -3. To review a specific file, click the **Open File** icon in the sidebar. - ![Option to open PR in a codespace](/assets/images/help/codespaces/changes-in-files.png) -4. To add review comments, click the **+** icon next to the line number. Type your review comment and then click **Start Review**. - ![Option to open PR in a codespace](/assets/images/help/codespaces/start-review.png) -5. When you are finished adding review comments, from the sidebar you can choose to either submit the comments, approve the changes, or request changes. - ![Option to open PR in a codespace](/assets/images/help/codespaces/submit-review.png) +1. 将默认编辑器设置为 {% data variables.product.prodname_vscode %} 或 {% data variables.product.prodname_vscode %} for Web,在 codespace 中打开拉取请求,如上面的“[打开拉取请求](/codespaces/developing-in-codespaces/using-codespaces-for-pull-requests#opening-a-pull-request-in-codespaces)”中所述。 +2. 在活动栏中,单击“GitHub 拉取请求”视图。 仅当在代码空间中打开拉取请求时,才会显示此视图。 + ![用于在代码空间中打开 PR 的选项](/assets/images/help/codespaces/github-pr-view.png) +3. 若要查看特定文件,请单击边栏中的“打开文件”图标。 + ![用于在代码空间中打开 PR 的选项](/assets/images/help/codespaces/changes-in-files.png) +4. 若要添审阅注释,请单击行号旁边的 + 图标。 键入审阅注释,然后单击“开始审阅”。 + ![用于在代码空间中打开 PR 的选项](/assets/images/help/codespaces/start-review.png) +5. 添加完审阅注释后,可以从边栏中选择提交评论、批准更改或请求更改。 + ![用于在代码空间中打开 PR 的选项](/assets/images/help/codespaces/submit-review.png) -For more information on reviewing a pull request, see "[Reviewing proposed changes in a pull request](/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request)." +有关查看拉取请求的详细信息,请参阅“[查看拉取请求中的建议更改](/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request)”。 -## View comments from a review in {% data variables.product.prodname_codespaces %} +## 查看 {% data variables.product.prodname_codespaces %} 中审阅的评论 -Once you have received feedback on a pull request, you can [open it in a codespace](#opening-a-pull-request-in-codespaces) in your web browser, or in {% data variables.product.prodname_vscode_shortname %}, to see the [review comments](#reviewing-a-pull-request-in-codespaces). From there you can respond to comments, add reactions, or dismiss the review. +收到有关拉取请求的反馈后,可以在 Web 浏览器的 [codespace](#opening-a-pull-request-in-codespaces) 或 {% data variables.product.prodname_vscode_shortname %} 中打开它,以查看[审阅注释](#reviewing-a-pull-request-in-codespaces)。 从那里,您可以回复评论、添加回复或关闭评论。 - ![Option to open PR in a codespace](/assets/images/help/codespaces/incorporating-codespaces.png) + ![用于在代码空间中打开 PR 的选项](/assets/images/help/codespaces/incorporating-codespaces.png) diff --git a/translations/zh-CN/content/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code.md b/translations/zh-CN/content/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code.md index 74635bca2b..47cc4ced26 100644 --- a/translations/zh-CN/content/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code.md +++ b/translations/zh-CN/content/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code.md @@ -1,7 +1,7 @@ --- -title: Using GitHub Codespaces in Visual Studio Code +title: 在 Visual Studio Code 中使用 GitHub Codespaces shortTitle: Visual Studio Code -intro: 'You can develop in your codespace directly in {% data variables.product.prodname_vscode %} by connecting the {% data variables.product.prodname_github_codespaces %} extension with your account on {% data variables.product.product_name %}.' +intro: '可以将 {% data variables.product.prodname_github_codespaces %} 扩展连接到 {% data variables.product.product_name %} 上的帐户,直接在 {% data variables.product.prodname_vscode %} 中开发 codespace。' redirect_from: - /github/developing-online-with-codespaces/using-codespaces-in-visual-studio-code - /github/developing-online-with-codespaces/connecting-to-your-codespace-from-visual-studio-code @@ -15,70 +15,75 @@ topics: - Codespaces - Visual Studio Code - Developer +ms.openlocfilehash: c651620e2795fb29f2b995f745ad3880e99c0f4e +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159440' --- - -## About {% data variables.product.prodname_github_codespaces %} in {% data variables.product.prodname_vscode %} +## 关于 {% data variables.product.prodname_vscode %} 中的 {% data variables.product.prodname_github_codespaces %} -You can use your local install of {% data variables.product.prodname_vscode %} to create, manage, work in, and delete codespaces. {% data reusables.codespaces.using-codespaces-in-vscode %} For more information on setting up {% data variables.product.prodname_github_codespaces %} in {% data variables.product.prodname_vscode_shortname %}, see "[Prerequisites](#prerequisites)." +您可以使用本地安装的 {% data variables.product.prodname_vscode %} 来创建、管理、处理和删除代码空间。 {% data reusables.codespaces.using-codespaces-in-vscode %} 有关在 {% data variables.product.prodname_vscode_shortname %} 中设置 {% data variables.product.prodname_github_codespaces %} 的详细信息,请参见“[先决条件](#prerequisites)”。 -By default, if you create a new codespace on {% data variables.product.prodname_dotcom_the_website %}, it will open in the browser. If you would prefer to open any new codespaces in {% data variables.product.prodname_vscode_shortname %} automatically, you can set your default editor to be {% data variables.product.prodname_vscode_shortname %}. For more information, see "[Setting your default editor for {% data variables.product.prodname_github_codespaces %}](/codespaces/customizing-your-codespace/setting-your-default-editor-for-github-codespaces)." +默认情况下,如果在 {% data variables.product.prodname_dotcom_the_website %} 上创建新的代码空间,它将在浏览器中打开。 如果希望自动打开 {% data variables.product.prodname_vscode_shortname %} 中的任何新 codespace,则可以将默认编辑器设置为 {% data variables.product.prodname_vscode_shortname %}。 有关详细信息,请参阅“[设置 {% data variables.product.prodname_github_codespaces %} 的默认编辑器](/codespaces/customizing-your-codespace/setting-your-default-editor-for-github-codespaces)”。 -If you prefer to work in the browser, but want to continue using your existing {% data variables.product.prodname_vscode_shortname %} extensions, themes, and shortcuts, you can turn on Settings Sync. For more information, see "[Personalizing {% data variables.product.prodname_github_codespaces %} for your account](/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account#settings-sync)." +如果你更喜欢在浏览器中工作,但想要继续使用现有 {% data variables.product.prodname_vscode_shortname %} 扩展、主题和快捷方式,可打开“设置同步”。有关详细信息,请参阅“[个性化帐户的 {% data variables.product.prodname_github_codespaces %}](/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account#settings-sync)”。 -## Prerequisites +## 先决条件 -To develop in a codespace directly in {% data variables.product.prodname_vscode_shortname %}, you must install and sign into the {% data variables.product.prodname_github_codespaces %} extension with your {% data variables.product.product_name %} credentials. The {% data variables.product.prodname_github_codespaces %} extension requires {% data variables.product.prodname_vscode_shortname %} October 2020 Release 1.51 or later. +若要直接在 {% data variables.product.prodname_vscode_shortname %} 的 codespace 中进行开发,必须使用 {% data variables.product.product_name %} 凭据安装并登录到 {% data variables.product.prodname_github_codespaces %} 扩展。 {% data variables.product.prodname_github_codespaces %} 扩展需要 {% data variables.product.prodname_vscode_shortname %} 2020 年 10 月 版本 1.51 或更高版本。 -Use the {% data variables.product.prodname_vscode_marketplace %} to install the [{% data variables.product.prodname_github_codespaces %}](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces) extension. For more information, see [Extension Marketplace](https://code.visualstudio.com/docs/editor/extension-gallery) in the {% data variables.product.prodname_vscode_shortname %} documentation. +使用 {% data variables.product.prodname_vscode_marketplace %} 安装 [{% data variables.product.prodname_github_codespaces %}](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces) 扩展。 有关详细信息,请参阅 {% data variables.product.prodname_vscode_shortname %} 文档中的[扩展市场](https://code.visualstudio.com/docs/editor/extension-gallery)。 {% mac %} {% data reusables.codespaces.click-remote-explorer-icon-vscode %} -1. Click **Sign in to {% data variables.product.prodname_dotcom %}...**. +1. 单击“登录到 {% data variables.product.prodname_dotcom %}…”。 - ![Signing in to {% data variables.product.prodname_github_codespaces %}](/assets/images/help/codespaces/sign-in-to-view-codespaces-vscode-mac.png) + ![登录到 {% data variables.product.prodname_github_codespaces %}](/assets/images/help/codespaces/sign-in-to-view-codespaces-vscode-mac.png) -2. To authorize {% data variables.product.prodname_vscode_shortname %} to access your account on {% data variables.product.product_name %}, click **Allow**. -3. Sign in to {% data variables.product.product_name %} to approve the extension. +2. 要授权 {% data variables.product.prodname_vscode_shortname %} 访问你在 {% data variables.product.product_name %} 上的帐户,请单击“允许”。 +3. 登录 {% data variables.product.product_name %} 以审批扩展。 {% endmac %} {% windows %} {% data reusables.codespaces.click-remote-explorer-icon-vscode %} -1. Use the "REMOTE EXPLORER" drop-down, then click **{% data variables.product.prodname_github_codespaces %}**. +1. 使用“远程资源管理器”下拉列表,然后单击“{% data variables.product.prodname_github_codespaces %}”。 - ![The {% data variables.product.prodname_github_codespaces %} header](/assets/images/help/codespaces/codespaces-header-vscode.png) + ![{% data variables.product.prodname_github_codespaces %} 标头](/assets/images/help/codespaces/codespaces-header-vscode.png) -1. Click **Sign in to view {% data variables.product.prodname_codespaces %}**. +1. 单击“登录以查看 {% data variables.product.prodname_codespaces %}”。 - ![Signing in to view {% data variables.product.prodname_github_codespaces %}](/assets/images/help/codespaces/sign-in-to-view-codespaces-vscode.png) + ![登录以查看 {% data variables.product.prodname_github_codespaces %}](/assets/images/help/codespaces/sign-in-to-view-codespaces-vscode.png) -1. To authorize {% data variables.product.prodname_vscode_shortname %} to access your account on {% data variables.product.product_name %}, click **Allow**. -1. Sign in to {% data variables.product.product_name %} to approve the extension. +1. 要授权 {% data variables.product.prodname_vscode_shortname %} 访问你在 {% data variables.product.product_name %} 上的帐户,请单击“允许”。 +1. 登录 {% data variables.product.product_name %} 以审批扩展。 {% endwindows %} -## Creating a codespace in {% data variables.product.prodname_vscode_shortname %} +## 在 {% data variables.product.prodname_vscode_shortname %} 中创建 codespace {% data reusables.codespaces.creating-a-codespace-in-vscode %} -## Opening a codespace in {% data variables.product.prodname_vscode_shortname %} +## 在 {% data variables.product.prodname_vscode_shortname %} 中打开 codespace {% data reusables.codespaces.click-remote-explorer-icon-vscode %} -1. Under "Codespaces", click the codespace you want to develop in. -1. Click the Connect to Codespace icon. +1. 在“Codespaces(代码空间)”下,单击您要在其中开发的代码空间。 +1. 单击 Connect to Codespace(连接到代码空间)图标。 - ![The Connect to Codespace icon in {% data variables.product.prodname_vscode_shortname %}](/assets/images/help/codespaces/click-connect-to-codespace-icon-vscode.png) + ![{% data variables.product.prodname_vscode_shortname %} 中的“连接到 codespace”图标](/assets/images/help/codespaces/click-connect-to-codespace-icon-vscode.png) -## Changing the machine type in {% data variables.product.prodname_vscode_shortname %} +## 在 {% data variables.product.prodname_vscode_shortname %} 中更改计算机类型 -{% data reusables.codespaces.codespaces-machine-types %} You can change the machine type of your codespace at any time. +{% data reusables.codespaces.codespaces-machine-types %} 可以随时更改 codespace 的计算机类型。 {% note %} -**Note**: {% data reusables.codespaces.codespaces-machine-type-availability %} +注意:{% data reusables.codespaces.codespaces-machine-type-availability %} {% endnote %} @@ -86,22 +91,22 @@ Use the {% data variables.product.prodname_vscode_marketplace %} to install the {% data reusables.codespaces.about-changing-storage-size %} -## Deleting a codespace in {% data variables.product.prodname_vscode_shortname %} +## 在 {% data variables.product.prodname_vscode_shortname %} 中删除 codespace {% data reusables.codespaces.deleting-a-codespace-in-vscode %} -## Switching to the Insiders build of {% data variables.product.prodname_vscode_shortname %} +## 切换到 {% data variables.product.prodname_vscode_shortname %} 的预览体验版本 -You can use the [Insiders Build of {% data variables.product.prodname_vscode_shortname %}](https://code.visualstudio.com/docs/setup/setup-overview#_insiders-nightly-build) within {% data variables.product.prodname_github_codespaces %}. +可以在 {% data variables.product.prodname_github_codespaces %} 中使用 [{% data variables.product.prodname_vscode_shortname %} 的预览体验版本](https://code.visualstudio.com/docs/setup/setup-overview#_insiders-nightly-build)。 -1. In bottom left of your {% data variables.product.prodname_github_codespaces %} window, select **{% octicon "gear" aria-label="The settings icon" %} Settings**. -2. From the list, select "Switch to Insiders Version". +1. 在 {% data variables.product.prodname_github_codespaces %} 窗口的左下角,选择“{% octicon "gear" aria-label="The settings icon" %} 设置”。 +2. 从列表中,选择“Switch to Insiders Version(切换到内部版本)”。 - ![Clicking on "Insiders Build" in {% data variables.product.prodname_github_codespaces %}](/assets/images/help/codespaces/codespaces-insiders-vscode.png) + ![单击 {% data variables.product.prodname_github_codespaces %} 中的“预览体验版本”](/assets/images/help/codespaces/codespaces-insiders-vscode.png) -3. Once selected, {% data variables.product.prodname_github_codespaces %} will continue to open in Insiders Version. +3. 选择后,{% data variables.product.prodname_github_codespaces %} 将继续以内部版本打开。 -## Further reading +## 延伸阅读 -- "[Using the {% data variables.product.prodname_vscode_command_palette %} in {% data variables.product.prodname_github_codespaces %}](/codespaces/codespaces-reference/using-the-vs-code-command-palette-in-codespaces)" -- "[Using {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_github_codespaces %}](/codespaces/codespaces-reference/using-github-copilot-in-github-codespaces)" \ No newline at end of file +- “[在 {% data variables.product.prodname_github_codespaces %} 中使用 {% data variables.product.prodname_vscode_command_palette %}](/codespaces/codespaces-reference/using-the-vs-code-command-palette-in-codespaces)” +- “在[{% data variables.product.prodname_github_codespaces %} 中使用 {% data variables.product.prodname_copilot %}](/codespaces/codespaces-reference/using-github-copilot-in-github-codespaces)” diff --git a/translations/zh-CN/content/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide.md b/translations/zh-CN/content/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide.md new file mode 100644 index 0000000000..1c933278b8 --- /dev/null +++ b/translations/zh-CN/content/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide.md @@ -0,0 +1,138 @@ +--- +title: 在 JetBrains IDE 中使用 GitHub Codespaces +shortTitle: JetBrains IDEs +intro: 可以使用 JetBrains 网关连接到 codespace,并在你喜欢的 JetBrains IDE 中工作。 +miniTocMaxHeadingLevel: 3 +versions: + fpt: '*' + ghec: '*' +type: how_to +topics: + - Codespaces + - Developer +ms.openlocfilehash: f522bf481e932f9735560ee4a1fec21944ced2e7 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159504' +--- +{% data reusables.codespaces.codespaces-jetbrains-beta-note %} + +## 关于 JetBrains IDE 中的 {% data variables.product.prodname_codespaces %} + +如果使用 JetBrains IDE 来处理代码,则可以利用在 codespace 中工作的优势。 可以使用 JetBrains 网关应用程序执行此操作。 + +安装 JetBrains 网关后,可以将 JetBrains 设置为默认编辑器,然后每当从 {% data variables.product.prodname_dotcom_the_website %} 打开 codespace 时,JetBrains 网关将启动,以允许你选择 JetBrains IDE 并连接到 codespace。 + +{% note %} + +**注意**:JetBrains 网关中只有现有的 codespace 可用。 可以在 {% data variables.product.prodname_dotcom_the_website %} 中或使用 {% data variables.product.prodname_cli %} 创建 codespace。 有关详细信息,请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository)”。 + +{% endnote %} + +### JetBrains 远程开发连接过程 + +在 JetBrains IDE 中使用 codespace 的基本过程如下所示。 + +* 在 JetBrains 网关应用程序中,选择一个活动或已停止的 codespace。 +* 然后选择要使用的 JetBrains IDE。 +* 然后将所选 JetBrains IDE 下载到托管 codespace 和源代码的远程虚拟机。 +* 然后将 JetBrains 瘦客户端应用程序下载到本地计算机并启动。 +* 客户端应用程序连接到完整的后端 IDE。 +* 可以在客户端应用程序中以与在本地环境中相同的方式处理代码。 + +## 先决条件 + +若要在 JetBrains IDE 中的 codespace 中工作,需要: + +* 有效的 JetBrains 许可证 +* JetBrains 网关应用程序 +* {% data variables.product.prodname_cli %} 版本 2.18.0 或更高版本 +* 运行 SSH 服务器的现有 codespace + +### JetBrains 许可证 + +必须拥有至少一个受支持的 JetBrains IDE 的许可证,才能从 JetBrains 网关连接到 codespace。 + +### JetBrains 网关 + +可以从 JetBrains 工具箱应用程序安装和更新 JetBrains 网关。 + +1. 下载并安装 [JetBrains 工具箱](https://www.jetbrains.com/toolbox-app)。 +1. 打开 JetBrains 工具箱。 +1. 在可用工具列表中找到“网关”,然后单击“安装” 。 + + ![JetBrains 工具箱的屏幕截图](/assets/images/help/codespaces/jetbrains-toolbox.png) + +### {% data variables.product.prodname_cli %} + +JetBrains 网关的 {% data variables.product.prodname_github_codespaces %} 插件要求先安装并配置 {% data variables.product.prodname_cli %} 版本 2.18.0 或更高版本,然后才能从 JetBrains 网关打开 codespace。 + +使用此命令检查 {% data variables.product.prodname_cli %} 的版本: + +```shell{:copy} +gh --version +``` + +有关详细信息,请参阅“[关于 GitHub CLI](/github-cli/github-cli/about-github-cli)”。 + +### 运行 SSH 服务器的 codespace + +必须具有要连接到的现有 codespace。 {% data reusables.codespaces.ways-to-create-a-codespace %} 有关详细信息,请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository)”。 + +{% data reusables.codespaces.ssh-server-installed %} + +有关 `devcontainer.json` 文件和默认容器映像的详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)”。 + +{% note %} + +**注意**:有关通过 SSH 连接到 codespace 的帮助,请参阅“[{% data variables.product.prodname_github_codespaces %} 客户端故障排除](/codespaces/troubleshooting/troubleshooting-github-codespaces-clients?tool=jetbrains#ssh-connection-issues)”。 + +{% endnote %} + +## 设置 JetBrains 网关 + +首次对 {% data variables.product.prodname_github_codespaces %} 使用 JetBrains 网关时,必须安装 {% data variables.product.prodname_codespaces %} 插件。 还必须允许 JetBrains 网关使用 {% data variables.product.prodname_dotcom %} 帐户访问 {% data variables.product.prodname_dotcom_the_website %}。 + +1. 打开 JetBrains 网关应用程序。 +1. 在“安装更多提供程序”下,单击 {% data variables.product.prodname_github_codespaces %} 的“安装”链接 。 + + ![JetBrains 网关初始视图的屏幕截图](/assets/images/help/codespaces/jetbrains-gateway-initial-view.png) + +1. 单击“连接到 Codespace”。 + + ![带有“连接到 Codespace”按钮的网关屏幕截图](/assets/images/help/codespaces/jetbrains-gateway-connect.png) + +1. 在“欢迎使用 JetBrains 网关”对话框中,单击“使用 {% data variables.product.prodname_dotcom %} 登录”。 + + ![“登录”按钮的屏幕截图](/assets/images/help/codespaces/jetbrains-gateway-sign-in.png) + +1. 单击一次性代码旁边的图标进行复制,然后单击登录链接。 + + ![一次性登录代码的屏幕截图](/assets/images/help/codespaces/jetbrains-gateway-login-code.png) + +1. 如果当前未登录到 {% data variables.product.prodname_dotcom %},则会显示登录页面。 + * 输入详细信息,然后单击“登录”。 + * 进行身份验证,例如输入双因素身份验证代码。 +1. 在“设备激活”页上,粘贴复制的代码,然后单击“继续”。 +1. 如果你属于组织,则会显示“单一登录到组织”页。 单击要授权 JetBrains 网关访问的组织旁边的“授权”,然后单击“继续” 。 +1. 在“为 JetBrains 授权 {% data variables.product.prodname_github_codespaces %}”页上,单击“授权 {% data variables.product.prodname_dotcom %}”。 +1. 返回到 JetBrains 网关应用程序,并从当前活动或已停止的 codespace 列表中打开一个 codespace,请参阅以下过程的步骤 3。 + +## 在 JetBrains IDE 中打开一个 codespace + +{% data reusables.codespaces.opening-codespace-in-jetbrains %} + + 首次连接到 codespace 时,后端 IDE 将下载到远程计算机。 这可能需要几分钟的时间。 下次连接到同一 codespace 时不需要执行此步骤,从而加快连接过程。 + + 然后启动后端 IDE。 同样,如果将来要重新连接到保持运行的后端 IDE,则不需要执行此步骤。 + + 然后启动客户端应用程序。 + +## 延伸阅读 + +- “[在 codespace 中开发](/codespaces/developing-in-codespaces/developing-in-a-codespace)” +- “[将 {% data variables.product.prodname_github_codespaces %} 插件用于 JetBrains](/codespaces/codespaces-reference/using-the-github-codespaces-plugin-for-jetbrains)” +- “[在 {% data variables.product.prodname_github_codespaces %} 中使用 {% data variables.product.prodname_copilot %}](/codespaces/codespaces-reference/using-github-copilot-in-github-codespaces)” +- “[{% data variables.product.prodname_github_codespaces %} 客户端故障排除](/codespaces/troubleshooting/troubleshooting-github-codespaces-clients?tool=jetbrains)” diff --git a/translations/zh-CN/content/codespaces/developing-in-codespaces/using-source-control-in-your-codespace.md b/translations/zh-CN/content/codespaces/developing-in-codespaces/using-source-control-in-your-codespace.md index 4765a8908e..89780f52b1 100644 --- a/translations/zh-CN/content/codespaces/developing-in-codespaces/using-source-control-in-your-codespace.md +++ b/translations/zh-CN/content/codespaces/developing-in-codespaces/using-source-control-in-your-codespace.md @@ -1,6 +1,6 @@ --- -title: Using source control in your codespace -intro: After making changes to a file in your codespace you can quickly commit the changes and push your update to the remote repository. +title: 在代码空间中使用源控制 +intro: 在对代码空间中的文件进行更改后,您可以快速提交更改并将更新推送到远程仓库。 versions: fpt: '*' ghec: '*' @@ -10,37 +10,42 @@ topics: - Fundamentals - Developer shortTitle: Source control +ms.openlocfilehash: 513bf0729e1f04bf93f45999b2fa9e45231add5c +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159460' --- - {% jetbrains %} {% data reusables.codespaces.codespaces-jetbrains-beta-note %} {% endjetbrains %} -## About source control in {% data variables.product.prodname_github_codespaces %} +## 关于 {% data variables.product.prodname_github_codespaces %} 中的源代码管理 -You can perform all the Git actions you need directly within your codespace. For example, you can fetch changes from a remote repository, switch branches, create a new branch, commit and push changes, and create a pull request. You can use the integrated terminal within your codespace to enter Git commands, or you can click icons and menu options to complete all the most common Git tasks. This guide explains how to use the graphical user interface for source control. +您可以直接在代码空间内执行所需的所有 Git 操作。 例如,可以从远程存储库获取更改、切换分支、创建新分支、提交和推送更改以及创建拉取请求。 您可以使用代码空间内的集成终端输入 Git 命令,也可以单击图标和菜单选项以完成所有最常见的 Git 任务。 本指南解释如何使用图形用户界面来控制源代码。 {% vscode %} -For more information about Git support in {% data variables.product.prodname_vscode %}, see "[Using Version Control in VS Code](https://code.visualstudio.com/docs/editor/versioncontrol#_git-support)" in the {% data variables.product.prodname_vscode %} documentation. +有关 {% data variables.product.prodname_vscode %} 中的 Git 支持的详细信息,请参阅 {% data variables.product.prodname_vscode %} 文档中的“[在 VS Code 中使用版本控制](https://code.visualstudio.com/docs/editor/versioncontrol#_git-support)”。 {% endvscode %} {% webui %} -Source control in the {% data variables.product.prodname_vscode %} web client uses the same workflow as the {% data variables.product.prodname_vscode %} desktop application. For more information, see "[Using Version Control in VS Code](https://code.visualstudio.com/docs/editor/versioncontrol#_git-support)" in the {% data variables.product.prodname_vscode %} documentation. +{% data variables.product.prodname_vscode %} Web 客户端中的源代码管理使用与 {% data variables.product.prodname_vscode %} 桌面应用程序相同的工作流。 有关详细信息,请参阅 {% data variables.product.prodname_vscode %} 文档中的“[在 VS Code 中使用版本控制](https://code.visualstudio.com/docs/editor/versioncontrol#_git-support)”。 {% endwebui %} -A typical workflow for updating a file using {% data variables.product.prodname_github_codespaces %} would be: +使用 {% data variables.product.prodname_github_codespaces %} 更新文件的典型工作流程将是: -* From the default branch of your repository on {% data variables.product.prodname_dotcom %}, create a codespace. See "[Creating a codespace for a repository](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository)." -* In your codespace, create a new branch to work on. -* Make your changes and save them. -* Commit the change. -* Raise a pull request. +* 从 {% data variables.product.prodname_dotcom %} 上仓库的默认分支,创建代码空间。 请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository)”。 +* 在代码空间中,创建一个新的分支来操作。 +* 进行更改并保存。 +* 提交更改。 +* 提出拉取请求。 {% webui %} @@ -56,67 +61,67 @@ A typical workflow for updating a file using {% data variables.product.prodname_ {% jetbrains %} -## Creating or switching branches +## 创建或切换分支 -1. Click the branch name at the right side of the status bar. +1. 单击状态栏右侧的分支名称。 - ![Screenshot of the branch name in the status bar](/assets/images/help/codespaces/jetbrains-branch-button.png) + ![状态栏中的分支名称的屏幕截图](/assets/images/help/codespaces/jetbrains-branch-button.png) -1. In the pop-up menu, do one of the following: - * To create a new branch based on the current branch, click the name of the current branch, then choose **New Branch**. +1. 在弹出菜单中,执行以下操作之一: + * 要基于当前分支创建新分支,请单击当前分支的名称,然后选择“新建分支”。 - ![Screenshot of the new branch option](/assets/images/help/codespaces/jetbrains-new-branch-option.png) + ![“新建分支”选项的屏幕截图](/assets/images/help/codespaces/jetbrains-new-branch-option.png) - Enter a name for the new branch and click **Create**. + 输入新建分支的名称并单击“创建”。 - ![Screenshot of the create branch dialog box](/assets/images/help/codespaces/jetbrains-create-branch-dialog.png) + ![“创建分支”对话框的屏幕截图](/assets/images/help/codespaces/jetbrains-create-branch-dialog.png) - * To check out an existing branch, start typing the name of the branch you want to check out. Click the branch from the list, then click **Checkout**. + * 要签出现有分支,请开始键入要签出的分支的名称。单击列表中的分支,然后单击“签出”。 - ![Screenshot of the checkout option](/assets/images/help/codespaces/jetbrains-checkout-submenu.png) + ![签出页面的屏幕截图](/assets/images/help/codespaces/jetbrains-checkout-submenu.png) {% tip %} - **Tip**: If someone has recently changed a file on the remote repository, in the branch you switched to, you may not see those changes until you pull the changes into your codespace. + 提示:如果有人最近在远程存储库上更改了文件,则在你切换到的分支中,只有将更改拉取到 codespace 中之后,你才能看到这些更改。 {% endtip %} -## Committing your changes +## 提交更改 -1. At the right side of the navigation bar, click the check mark. +1. 在导航栏的右侧,单击复选标记。 - ![Screenshot of the commit check mark](/assets/images/help/codespaces/jetbrains-commit-button.png) + ![“提交”复选标记的屏幕截图](/assets/images/help/codespaces/jetbrains-commit-button.png) -1. In the Commit Changes dialog box, enter a commit message. -1. Click **Commit**. +1. 在“提交更改”对话框中,输入提交消息。 +1. 单击“提交”。 - Alternatively, click the down arrow beside **Commit** and click **Commit and Push**. + 此外,也可以单击“提交”旁边的向下箭头,然后单击“提交并推送” 。 - ![Screenshot of the commit and push button](/assets/images/help/codespaces/jetbrains-commit-and-push.png) + ![“提交并推送”按钮的屏幕截图](/assets/images/help/codespaces/jetbrains-commit-and-push.png) -## Pulling changes from the remote repository +## 从远程仓库拉取更改 -You can pull changes from the same branch on the remote repository and apply those changes to the copy of the repository you are working on in your codespace. +可以从远程存储库的同一分支中拉取更改,并将这些更改应用到你在 codespace 中处理的存储库副本。 -1. At the right side of the navigation bar, click the downward pointing arrow. +1. 在导航栏的右侧,单击向下箭头。 - ![Screenshot of the update project downward arrow button](/assets/images/help/codespaces/jetbrains-update-project-button.png) + ![更新项目向下箭头按钮的屏幕截图](/assets/images/help/codespaces/jetbrains-update-project-button.png) -1. In the Update Project dialog box, choose whether you want to merge or rebase the incoming changes. +1. 在“更新项目”对话框中,选择是要合并还是变基传入的更改。 - ![Screenshot of the Update Project dialog box](/assets/images/help/codespaces/jetbrains-update-options.png) + ![“更新项目”对话框的屏幕截图](/assets/images/help/codespaces/jetbrains-update-options.png) -1. Click **OK**. +1. 单击 **“确定”** 。 -## Pushing changes to your remote repository +## 将更改推送到远程仓库 -You can push changes you've saved and committed. This applies those changes to the upstream branch on the remote repository. You might want to do this if you're not yet ready to create a pull request, or if you prefer to create a pull request on {% data variables.product.prodname_dotcom %}. +可以推送保存并提交的更改。 这将应用这些更改到远程仓库上的上游分支。 如果您尚未准备好创建拉取请求,或者希望在 {% data variables.product.prodname_dotcom %} 上创建拉取请求,则可能需要这样做。 -1. At the right side of the navigation bar, click the upward pointing arrow. +1. 在导航栏的右侧,单击向上箭头。 - ![Screenshot of the push commits upward arrow](/assets/images/help/codespaces/jetbrains-push-button.png) + ![“推送提交”向上箭头的屏幕截图](/assets/images/help/codespaces/jetbrains-push-button.png) -1. In the Push Commits dialog box, click **Push**. +1. 在“推送提交”对话框中,单击“推送”。 {% endjetbrains %} diff --git a/translations/zh-CN/content/codespaces/getting-started/deep-dive.md b/translations/zh-CN/content/codespaces/getting-started/deep-dive.md index 48c9c1004b..6580b239b2 100644 --- a/translations/zh-CN/content/codespaces/getting-started/deep-dive.md +++ b/translations/zh-CN/content/codespaces/getting-started/deep-dive.md @@ -1,7 +1,7 @@ --- -title: 'Deep dive into {% data variables.product.prodname_github_codespaces %}' +title: '深入了解 {% data variables.product.prodname_github_codespaces %}' shortTitle: 'Deep dive into {% data variables.product.prodname_codespaces %}' -intro: 'Understand how {% data variables.product.prodname_github_codespaces %} works.' +intro: '了解 {% data variables.product.prodname_github_codespaces %} 的工作原理。' allowTitleToDifferFromFilename: true versions: fpt: '*' @@ -9,151 +9,156 @@ versions: type: quick_start topics: - Codespaces +ms.openlocfilehash: 5f97a137ec09191d5cbaa9c10aa280e10f11bbc0 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158643' --- +{% data variables.product.prodname_github_codespaces %} 是一个基于云的即时开发环境,它使用容器为你提供用于开发的通用语言、工具和实用程序。 {% data variables.product.prodname_github_codespaces %} 也是可配置的,通过它可为项目创建自定义的开发环境。 通过为项目配置自定义开发环境,可以为项目的所有用户提供可重复的代码空间配置。 -{% data variables.product.prodname_github_codespaces %} is an instant, cloud-based development environment that uses a container to provide you with common languages, tools, and utilities for development. {% data variables.product.prodname_github_codespaces %} is also configurable, allowing you to create a customized development environment for your project. By configuring a custom development environment for your project, you can have a repeatable codespace configuration for all users of your project. +## 创建代码空间 -## Creating your codespace +有许多入口点可用于创建代码空间。 -There are a number of entry points to create a codespace. - -- From a {% data variables.product.company_short %} template or any template repository on {% data variables.product.prodname_dotcom_the_website %} to start a new project -- From a branch in your repository for new feature work -- From an open pull request to explore work-in-progress -- From a commit in a repository's history to investigate a bug at a specific point in time +- 通过 {% data variables.product.company_short %} 模板或 {% data variables.product.prodname_dotcom_the_website %} 上的任何模板存储库启动新项目 +- 使用存储库中的分支进行新功能工作 +- 使用打开的拉取请求探索正在进行的工作 +- 使用存储库历史记录中的提交项调查特定时间点的 bug。 {% data reusables.codespaces.ways-to-create-a-codespace %} -Your codespace can be ephemeral if you need to test something or you can return to the same codespace to work on long-running feature work. +如果需要测试某些内容,则代码空间可以是短暂的,或者可以返回到同一代码空间来处理长时间运行的功能工作。 -For more information, see "[Creating a codespace for a repository](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository)," "[Creating a codespace from a template](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template)," and "[Opening an existing codespace](/codespaces/developing-in-codespaces/opening-an-existing-codespace)." +有关详细信息,请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository)”、“[通过模板创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template)”和“[打开现有 codespace](/codespaces/developing-in-codespaces/opening-an-existing-codespace)”。 {% note %} -**Note**: You can create more than one codespace per repository or even per branch. However, there are limits to the number of codespaces you can create, and the number of codespaces you can run at the same time. If you reach the maximum number of codespaces and try to create another, a message is displayed telling you that you must remove an existing codespace before you can create a new one. +注意:可为每个存储库甚至每个分支创建多个 codespace。 但是,可以创建的 codespace 数量和可以同时运行的 codespace 数量受到限制。 如果达到最大 codespace 数并尝试创建另一个 codespace,则会显示一条消息,告知你必须删除现有 codespace,然后才能创建新的 codespace。 {% endnote %} -### The codespace creation process +### codespace 创建过程 -When you create a codespace, various steps happen in the background before the codespace is available to you. +创建 codespace 时,各个步骤将在后台执行,然后 codespace 可供你使用。 -### Step 1: VM and storage are assigned to your codespace +### 步骤 1:将虚拟机和存储分配给代码空间 -When you create a codespace, a [shallow clone](https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/) is made of your repository, or of the template repository if you're creating a codespace from a template. The repository is cloned to a Linux virtual machine that is both dedicated and private to you. Having a dedicated VM ensures that you have the entire set of compute resources from that machine available to you. If necessary, this also allows you to have full root access to your container. +创建 codespace 时,将创建存储库的[浅克隆](https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/),如果是通过模板创建 codespace,则将创建模板存储库的浅克隆。 存储库将克隆到你的专用 Linux 虚拟机。 拥有专用虚拟机可确保您拥有该计算机中可供使用的整个计算资源集。 如有必要,这还允许您对容器具有完全根访问权限。 -### Step 2: Container is created +### 步骤 2:创建容器 -{% data variables.product.prodname_github_codespaces %} uses a container as the development environment. This container is created based on configurations that you can define in a `devcontainer.json` file and, optionally, a Dockerfile. If you create a codespace from {% data variables.product.company_short %}'s blank template, or from a repository with no `devcontainer.json` file, {% data variables.product.prodname_github_codespaces %} uses a default image, which has many languages and runtimes available. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)." For details of what the default image contains, see the [`microsoft/vscode-dev-containers`](https://github.com/microsoft/vscode-dev-containers/tree/main/containers/codespaces-linux) repository. +{% data variables.product.prodname_github_codespaces %} 使用容器作为开发环境。 此容器是根据你可以在 `devcontainer.json` 文件以及 Dockerfile(可选)中定义的配置创建的。 如果通过 {% data variables.product.company_short %} 的空白模板或不包含 `devcontainer.json` 文件的存储库创建 codespace,{% data variables.product.prodname_github_codespaces %} 将使用具有多种语言和运行时的默认映像。 有关详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)”。 若要详细了解默认映像包含的内容,请参阅 [`microsoft/vscode-dev-containers`](https://github.com/microsoft/vscode-dev-containers/tree/main/containers/codespaces-linux) 存储库。 {% note %} -**Note:** If you want to use Git hooks in your codespace and apply anything in the [git template directory](https://git-scm.com/docs/git-init#_template_directory) to your codespace, then you must set up hooks during step 4 after the container is created. +注意:如果要在 codespace 中使用 Git 挂钩,并将 [git 模板目录](https://git-scm.com/docs/git-init#_template_directory)中的任何内容应用于 codespace,则必须在创建容器后在步骤 4 中设置挂钩。 -Since your repository is cloned onto the host VM before the container is created, anything in the [git template directory](https://git-scm.com/docs/git-init#_template_directory) will not apply in your codespace unless you set up hooks in your `devcontainer.json` configuration file using the `postCreateCommand` in step 4. For more information, see "[Step 4: Post-creation setup](#step-4-post-creation-setup)." +由于存储库在创建容器之前已克隆到主机 VM 上,因此 [git 模板目录](https://git-scm.com/docs/git-init#_template_directory)中的任何内容都不会应用于 codespace,除非你在步骤 4 中使用 `postCreateCommand` 在 `devcontainer.json` 配置文件中设置挂钩。 有关详细信息,请参阅“[步骤 4:创建后设置](#step-4-post-creation-setup)”。 {% endnote %} -### Step 3: Connecting to the codespace +### 步骤 3:连接到代码空间 -When your container has been created and any other initialization has run, you'll be connected to your codespace. You can connect to it by using: +创建容器并运行任何其他初始化后,您将连接到代码空间。 可以使用以下方法建立连接: -* Your web browser +* Web 浏览器 * [Visual Studio Code](/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code) -* [A JetBrains IDE](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide) +* [JetBrains IDE](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide) * [{% data variables.product.prodname_cli %}](/codespaces/developing-in-codespaces/using-github-codespaces-with-github-cli) -### Step 4: Post-creation setup +### 步骤 4:创建后设置 -Once you are connected to your codespace, your automated setup may continue to build based on the configuration specified in your `devcontainer.json` file. You may see `postCreateCommand` and `postAttachCommand` run. +连接到 codespace 后,你的自动设置可能会根据你在 `devcontainer.json` 文件中指定的配置继续构建。 你可能会看到 `postCreateCommand` 和 `postAttachCommand` 运行。 -If you want to use Git hooks in your codespace, set up hooks using the [`devcontainer.json` lifecycle scripts](https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_lifecycle-scripts), such as `postCreateCommand`. For more information, see the [`devcontainer.json` reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_devcontainerjson-properties) in the {% data variables.product.prodname_vscode_shortname %} documentation. +如果要在 codespace 中使用 Git 挂钩,请使用 [`devcontainer.json` 生命周期脚本](https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_lifecycle-scripts)设置挂钩,例如 `postCreateCommand`。 有关详细信息,请参阅 {% data variables.product.prodname_vscode_shortname %} 文档中的 [`devcontainer.json` 参考](https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_devcontainerjson-properties)。 -If you have a public dotfiles repository for {% data variables.product.prodname_github_codespaces %}, you can enable it for use with new codespaces. When enabled, your dotfiles will be cloned to the container and the install script will be invoked. For more information, see "[Personalizing {% data variables.product.prodname_github_codespaces %} for your account](/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account#dotfiles)." +如果你有一个用于 {% data variables.product.prodname_github_codespaces %} 的公共 dotfile 存储库,则可以启用它以用于新的 codespace。 启用后,您的 dotfile 将被克隆到容器中,并且将调用安装脚本。 有关详细信息,请参阅“[为帐户设置个性化的 {% data variables.product.prodname_github_codespaces %}](/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account#dotfiles)”。 -Finally, if you created the codespace from a repository, the entire history of the repository is copied down with a full clone. If you created the codespace from a template, the full history of the template repository is not preserved; instead, unless you are using the blank template, you will start with an initial commit for the contents of the template repository. +最后,如果通过存储库创建了 codespace,则会使用完整克隆复制存储库的整个历史记录。 如果通过模板创建了 codespace,则不会保留模板存储库的完整历史记录;除非改为使用空白模板,否则将从模板存储库内容的初始提交开始。 -During post-creation setup you'll still be able to use the integrated terminal and make edits to your files, but take care to avoid any race conditions between your work and the commands that are running. -## {% data variables.product.prodname_codespaces %} lifecycle +在创建后设置期间,您仍然可以使用集成终端并对文件进行编辑,但要注意避免工作与正在运行的命令之间存在任何争用条件。 +## {% data variables.product.prodname_codespaces %} 生命周期 -### Saving files in your codespace +### 在代码空间中保存文件 -Save changes to files in the normal way, depending on the editor you are using. +根据所用的编辑器以常规方式保存对文件的更改。 -If you work on codespaces in {% data variables.product.prodname_vscode %}, you can enable [Auto Save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) to ensure that your changes are always saved. +如果要处理 {% data variables.product.prodname_vscode %} 中的 codespace,则可以启用[自动保存](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save)以确保始终保存所做更改。 -### Closing or stopping your codespace +### 关闭或停止代码空间 -Your codespace will keep running while you are using it, but will time out after a period of inactivity. File changes from the editor and terminal output are counted as activity, so your codespace will not time out if terminal output is continuing. The default inactivity timeout period is 30 minutes. You can define your personal timeout setting for codespaces you create, but this may be overruled by an organization timeout policy. For more information, see "[Setting your timeout period for Codespaces](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces)." +使用 codespace 时,它将保持运行,但在处于非活动状态一段时间后会超时。 编辑器和终端输出中的文件更改将计为活动,因此,如果终端输出继续,codespace 将不会超时。 默认非活动超时期限为 30 分钟。 可以为创建的 codespace 定义个人超时设置,但这可能会被组织超时策略覆盖。 有关详细信息,请参阅“[为 codespace 设置超时期限](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces)”。 -If a codespace times out it will stop running, but you can restart it from the browser tab (if you were using the codespace in the browser), from within {% data variables.product.prodname_vscode_shortname %}, or from your list of codespaces at [https://github.com/codespaces](https://github.com/codespaces). +如果 codespace 超时,它将停止运行,但可通过以下方式重启:浏览器选项卡(如果在浏览器中使用 codespace)、{% data variables.product.prodname_vscode_shortname %}、[https://github.com/codespaces](https://github.com/codespaces) 中的 codespace 列表。 -To stop your codespace you can +可通过以下方式停止 codespace -* In the browser: on your list of codespaces at [https://github.com/codespaces](https://github.com/codespaces), click the ellipsis (**...**) to the right of the codespace you want to stop and click **Stop codespace**. -* In {% data variables.product.prodname_vscode_shortname %}: open [the {% data variables.product.prodname_vscode_command_palette %}](/codespaces/codespaces-reference/using-the-vs-code-command-palette-in-codespaces#suspending-or-stopping-a-codespace) - for example, by pressing Ctrl+Shift+Enter (Windows/Linux) or Shift+Command+P (Mac) - type `Codespaces: stop` then press Enter. -* In the JetBrains client, click the stop button at the top of the {% data variables.product.prodname_github_codespaces %} tool window. For more information, see the "JetBrains IDEs" tab of "[Stopping and starting a codespace](/codespaces/developing-in-codespaces/stopping-and-starting-a-codespace)." -* In a terminal window: use the {% data variables.product.prodname_cli %} command `gh codespace stop`. For more information, see "[Using {% data variables.product.prodname_github_codespaces %} with {% data variables.product.prodname_cli %}](/codespaces/developing-in-codespaces/using-github-codespaces-with-github-cli#gh-commands-for-github-codespaces)." +* 浏览器:在 [https://github.com/codespaces](https://github.com/codespaces) 的 codespace 列表中,单击要停止的 codespace 右侧的省略号 (…),然后单击“停止 codespace” 。 +* {% data variables.product.prodname_vscode_shortname %}:打开 [the {% data variables.product.prodname_vscode_command_palette %}](/codespaces/codespaces-reference/using-the-vs-code-command-palette-in-codespaces#suspending-or-stopping-a-codespace) - 例如,按 Ctrl+Shift+Enter (Windows/Linux) 或 Shift+Command+P (Mac),键入 `Codespaces: stop`,然后按 Enter。 +* JetBrains 客户端:单击 {% data variables.product.prodname_github_codespaces %} 工具窗口顶部的停止按钮。 有关详细信息,请参阅“[停止和启动 codespace](/codespaces/developing-in-codespaces/stopping-and-starting-a-codespace)”的“JetBrains IDE”选项卡。 +* 终端窗口:使用 {% data variables.product.prodname_cli %} 命令 `gh codespace stop`。 有关详细信息,请参阅“[将 {% data variables.product.prodname_github_codespaces %} 与 {% data variables.product.prodname_cli %} 配合使用](/codespaces/developing-in-codespaces/using-github-codespaces-with-github-cli#gh-commands-for-github-codespaces)。 -If you exit your codespace without running the stop command (for example, by closing the browser tab), or if you leave the codespace running without interaction, the codespace and its running processes will continue for the duration of the inactivity timeout period. +如果在未运行停止命令的情况下退出 codespace(例如,关闭浏览器选项卡),或者让 codespace 在没有交互的情况下运行,则代码空间及其正在运行的进程将在非活动超时期限内继续运行。 -When you close or stop your codespace, all uncommitted changes are preserved until you connect to the codespace again. +关闭或停止代码空间时,将保留所有未提交的更改,直到您再次连接到代码空间。 -## Running your application +## 运行应用程序 -Port forwarding gives you access to TCP ports running within your codespace. For example, if you're running a web application on port 4000 within your codespace, you can automatically forward that port to make the application accessible from your browser. +通过端口转发,您可以访问在代码空间内运行的 TCP 端口。 例如,如果要在代码空间内的端口 4000 上运行 Web 应用程序,则可以自动转发该端口,以使该应用程序可从浏览器访问。 -Port forwarding determines which ports are made accessible to you from the remote machine. Even if you do not forward a port, that port is still accessible to other processes running inside the codespace itself. +端口转发确定可从远程计算机访问哪些端口。 即使不转发端口,在代码空间本身内运行的其他进程仍然可以访问该端口。 -![Diagram showing how port forwarding works in a codespace](/assets/images/help/codespaces/port-forwarding.png) +![显示端口转发在代码空间中的工作方式的图示](/assets/images/help/codespaces/port-forwarding.png) -When an application running inside {% data variables.product.prodname_github_codespaces %} outputs a port to the console, {% data variables.product.prodname_github_codespaces %} detects the localhost URL pattern and automatically forwards the port. You can click on the URL in the terminal, or the link in the "toast" notification message that pops up at the bottom right corner of {% data variables.product.prodname_vscode_shortname %}, to open the port in a browser. By default, {% data variables.product.prodname_github_codespaces %} forwards the port using HTTP. For more information on port forwarding, see "[Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)." +当在 {% data variables.product.prodname_github_codespaces %} 内运行的应用程序将端口输出到控制台时,{% data variables.product.prodname_github_codespaces %} 会检测 localhost URL 模式并自动转发该端口。 可以单击终端中的 URL,或单击 {% data variables.product.prodname_vscode_shortname %} 右下角弹出的“toast”通知消息中的链接在浏览器中打开端口。 默认情况下,{% data variables.product.prodname_github_codespaces %} 使用 HTTP 转发端口。 有关端口转发的详细信息,请参阅“[在 codespace 中转发端口](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)”。 -While ports can be forwarded automatically, they are not publicly accessible to the internet. By default, all ports are private, but you can manually make a port available to your organization or public, and then share access through a URL. For more information, see "[Sharing a port](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace#sharing-a-port)." +虽然端口可以自动转发,但它们不能被互联网公开访问。 默认情况下,所有端口都是私有的,但您可以手动使端口可供您的组织或公共使用,然后通过 URL 共享访问权限。 有关详细信息,请参阅“[共享端口](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace#sharing-a-port)”。 -Running your application when you first land in your codespace can make for a fast inner dev loop. As you edit, your changes are automatically saved and available on your forwarded port. To view changes, go back to the running application tab in your browser and refresh it. +首次登录代码空间时运行应用程序可以实现快速的内部开发循环。 编辑时,您的更改会自动保存,并可在转发的端口上使用。 要查看更改,请返回浏览器中正在运行的应用程序选项卡并刷新它。 -## Committing and pushing your changes +## 提交和推送更改 -Git is installed by default in your codespace and so you can rely on your existing Git workflow. You can work with Git in your codespace either via the Terminal or by using the source control features of {% data variables.product.prodname_vscode_shortname %} or JetBrains. +默认情况下,Git 安装在 codespace 中,因此你可以依赖现有的 Git 工作流。 你可以通过终端或者使用 {% data variables.product.prodname_vscode_shortname %} 或 JetBrains 的源代码管理功能在 codespace 中使用 Git。 -If you're working with an existing repository, you can create a codespace from any branch, commit, or pull request in the repository, or you can switch to a new or existing branch from within your active codespace. Because {% data variables.product.prodname_github_codespaces %} is designed to be ephemeral, you can use it as an isolated environment to experiment, check a teammate's pull request, or fix merge conflicts. +如果使用的是现有存储库,则可使用项目中的任何分支、提交或拉取请求创建 codespace,也可以从活动 codespace 中切换到新的或现有的分支。 由于 {% data variables.product.prodname_github_codespaces %} 设计为临时的,因此你可以将其用作隔离环境来试验、检查团队成员的拉取请求或修复合并冲突。 -If you're working in a codespace created from a template, Git will be installed by default, but you will need to publish your codespace to a remote repository to persist your work and to share it with others. If you start from {% data variables.product.company_short %}'s blank template, you will first need to initialize your workspace as a Git repository (for example by entering `git init`) to start using source control within the codespace. +如果使用的是通过模板创建的 codespace,则默认情况下将安装 Git,但需要将 codespace 发布到远程存储库,以保留工作并与其他人共享。 如果通过 {% data variables.product.company_short %} 的空白模板开始,则首先需要将工作区初始化为 Git 存储库(例如输入 `git init`),才能在 codespace 中开始使用源代码管理功能。 -For more information, see "[Using source control in your codespace](/codespaces/developing-in-codespaces/using-source-control-in-your-codespace)." +有关详细信息,请参阅[在 codespace 中使用源代码管理](/codespaces/developing-in-codespaces/using-source-control-in-your-codespace)。 {% note %} -**Note:** Commits from your codespace will be attributed to the name and public email configured at https://github.com/settings/profile. A token scoped to the repository, included in the environment as `GITHUB_TOKEN`, and your GitHub credentials will be used to authenticate. +注意:来自 codespace 的提交将属性化为在 https://github.com/settings/profile 配置的名称和公共电子邮件。 范围限定为存储库的令牌(作为 `GITHUB_TOKEN` 包含在环境中),你的 GitHub 凭据将用于身份验证。 {% endnote %} -## Personalizing your codespace with extensions or plugins +## 使用扩展或插件个性化 codespace -You can add plugins and extensions within a codespace to personalize your experience in JetBrains and {% data variables.product.prodname_vscode_shortname %} respectively. +可以在 codespace 中添加插件和扩展,分别对在 JetBrains 和 {% data variables.product.prodname_vscode_shortname %} 中的体验进行个性化设置。 -### {% data variables.product.prodname_vscode_shortname %} extensions +### {% data variables.product.prodname_vscode_shortname %} 扩展 -If you work on your codespaces in the {% data variables.product.prodname_vscode_shortname %} desktop application, or the web client, you can add any extensions you need from the {% data variables.product.prodname_vscode_marketplace %}. For information on how extensions run in {% data variables.product.prodname_github_codespaces %}, see [Supporting Remote Development and {% data variables.product.prodname_github_codespaces %}](https://code.visualstudio.com/api/advanced-topics/remote-extensions) in the {% data variables.product.prodname_vscode_shortname %} documentation. +如果在 {% data variables.product.prodname_vscode_shortname %} 桌面应用程序或 Web 客户端中使用 codespace,则可使用 {% data variables.product.prodname_vscode_marketplace %} 添加所需的任何扩展。 若要了解扩展如何在 {% data variables.product.prodname_github_codespaces %} 中运行,请参阅 {% data variables.product.prodname_vscode_shortname %} 文档中的[支持远程开发和 {% data variables.product.prodname_github_codespaces %}](https://code.visualstudio.com/api/advanced-topics/remote-extensions)。 -If you already use {% data variables.product.prodname_vscode_shortname %}, you can use [Settings Sync](https://code.visualstudio.com/docs/editor/settings-sync) to automatically sync extensions, settings, themes, and keyboard shortcuts between your local instance and any codespaces you create. +如果你已使用 {% data variables.product.prodname_vscode_shortname %},则可以使用[设置同步](https://code.visualstudio.com/docs/editor/settings-sync)在本地实例和你创建的任何 codespace 之间自动同步扩展、设置、主题和键盘快捷方式。 -### JetBrains plugins +### JetBrains 插件 -If you work on your codespaces in a JetBrains IDE, you can add plugins from the JetBrains Marketplace. +如果在 JetBrains IDE 中使用 codespace,则可使用 JetBrains Marketplace 添加插件。 -1. Click **JetBrains Client**, then click **Preferences**. -1. In the Preferences dialog box, click either **Plugins On Host** to install a plugin in the full JetBrains IDE that's running remotely, or **Plugins** to install a plugin on the local client, for example to change the user interface theme. -1. Click the **Marketplace** tab. +1. 单击 JetBrains 客户端,然后单击“首选项” 。 +1. 在“首选项”对话框中,单击“主机插件”可在远程运行的完整 JetBrains IDE 中安装插件,或单击“插件”可在本地客户端上安装插件,例如更改用户界面主题 。 +1. 单击“市场”选项卡。 - ![Screenshot of the Marketplace tab for 'Plugins On Host'](/assets/images/help/codespaces/jetbrains-preferences-plugins.png) + ![“主机插件”的“市场”选项卡的屏幕截图](/assets/images/help/codespaces/jetbrains-preferences-plugins.png) -1. Click **Install** beside the required plugin. +1. 单击所需插件旁边的“安装”。 -## Further reading +## 延伸阅读 -- "[Enabling {% data variables.product.prodname_github_codespaces %} for your organization](/codespaces/managing-codespaces-for-your-organization/enabling-github-codespaces-for-your-organization)" -- "[Managing the cost of {% data variables.product.prodname_github_codespaces %} in your organization](/codespaces/managing-codespaces-for-your-organization/managing-the-cost-of-github-codespaces-in-your-organization)" -- "[Add a dev container configuration to your repository](/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces)" -- "[The codespace lifecycle](/codespaces/developing-in-codespaces/the-codespace-lifecycle)" +- [为组织启用 {% data variables.product.prodname_github_codespaces %}](/codespaces/managing-codespaces-for-your-organization/enabling-github-codespaces-for-your-organization) +- [管理组织中的 {% data variables.product.prodname_github_codespaces %} 成本](/codespaces/managing-codespaces-for-your-organization/managing-the-cost-of-github-codespaces-in-your-organization) +- [将开发容器配置添加到存储库](/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces) +- [codespace 生命周期](/codespaces/developing-in-codespaces/the-codespace-lifecycle) diff --git a/translations/zh-CN/content/codespaces/getting-started/quickstart.md b/translations/zh-CN/content/codespaces/getting-started/quickstart.md index c432de015c..22394ac3be 100644 --- a/translations/zh-CN/content/codespaces/getting-started/quickstart.md +++ b/translations/zh-CN/content/codespaces/getting-started/quickstart.md @@ -1,7 +1,7 @@ --- -title: 'Quickstart for {% data variables.product.prodname_github_codespaces %}' +title: '{% data variables.product.prodname_github_codespaces %} 快速入门' shortTitle: 'Quickstart for {% data variables.product.prodname_codespaces %}' -intro: 'Try out {% data variables.product.prodname_github_codespaces %} in 5 minutes.' +intro: '在 5 分钟内试用 {% data variables.product.prodname_github_codespaces %}。' allowTitleToDifferFromFilename: true versions: fpt: '*' @@ -11,103 +11,108 @@ topics: - Codespaces redirect_from: - /codespaces/codespaces-quickstart +ms.openlocfilehash: f35fa87711ff3a7c33ed252d0d1e87865af619bc +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158651' --- +## 简介 -## Introduction +在本指南中,你将从模板存储库创建 codespace,并探索 codespace 中可用的一些基本功能。 你将使用 {% data variables.product.prodname_vscode %} 的浏览器版本,该版本最初是 {% data variables.product.prodname_github_codespaces %} 的默认编辑器。 尝试本快速入门后,可以在其他编辑器中使用 {% data variables.product.prodname_codespaces %},并且可以更改默认编辑器。 本指南末尾提供了相关链接。 -In this guide, you'll create a codespace from a template repository and explore some of the essential features available to you within the codespace. You'll work in the browser version of {% data variables.product.prodname_vscode %}, which is initially the default editor for {% data variables.product.prodname_github_codespaces %}. After trying out this quickstart you can use {% data variables.product.prodname_codespaces %} in other editors, and you can change the default editor. Links are provided at the end of this guide. +在本快速入门中,你将了解如何创建 codespace、连接到转发的端口以查看正在运行的应用程序、将 codespace 发布到一个新的存储库,以及通过扩展实现设置个性化。 -From this quickstart, you'll learn how to create a codespace, connect to a forwarded port to view your running application, publish your codespace to a new repository, and personalize your setup with extensions. +有关 {% data variables.product.prodname_github_codespaces %} 如何工作的详细信息,请参阅配套指南“[深入了解 {% data variables.product.prodname_github_codespaces %}](/codespaces/getting-started/deep-dive)”。 -For more information on exactly how {% data variables.product.prodname_github_codespaces %} works, see the companion guide "[Deep dive into {% data variables.product.prodname_github_codespaces %}](/codespaces/getting-started/deep-dive)." +## 创建代码空间 -## Creating your codespace - -1. Navigate to the [github/haikus-for-codespaces](https://github.com/github/haikus-for-codespaces) template repository. +1. 导航到 [github/haikus-for-codespaces](https://github.com/github/haikus-for-codespaces) 模板存储库。 {% data reusables.codespaces.open-template-in-codespace-step %} -## Running the application +## 运行应用程序 -Once your codespace is created, the template repository will be automatically cloned into it. Now you can run the application and launch it in a browser. +创建 codespace 后,模板存储库将自动克隆到其中。 现在,您可以运行该应用程序并在浏览器中启动它。 -1. When the terminal becomes available, enter the command `npm run dev`. This example uses a Node.js project, and this command runs the script labeled "dev" in the `package.json` file, which starts up the web application defined in the sample repository. +1. 当终端可用时,输入命令 `npm run dev`。 此示例使用 Node.js 项目,此命令运行 `package.json` 文件中标记为“dev”的脚本,该脚本启动示例存储库中定义的 Web 应用程序。 - ![npm run dev in terminal](/assets/images/help/codespaces/codespaces-npm-run-dev.png) + ![终端中的 npm run dev](/assets/images/help/codespaces/codespaces-npm-run-dev.png) - If you're following along with a different application type, enter the corresponding start command for that project. + 如果按照其他应用程序类型进行操作,请为该项目输入相应的启动命令。 -2. When your application starts, the codespace recognizes the port the application is running on and displays a prompt to let you know it has been forwarded. +2. 当应用程序启动时,codespace 会识别运行应用程序的端口,并显示该端口已转发的提示。 - ![Port forwarding "toast" notification](/assets/images/help/codespaces/quickstart-port-toast.png) + ![端口转发“toast”通知](/assets/images/help/codespaces/quickstart-port-toast.png) -3. Click **Open in Browser** to view your running application in a new tab. +3. 单击“在浏览器中打开”,在新选项卡中查看正在运行的应用程序。 -## Edit the application and view changes +## 编辑应用程序并查看更改 -1. Switch back to your codespace and open the `haikus.json` file by clicking it in the Explorer. +1. 切换回 codespace,并通过在文件资源管理器中单击 `haikus.json` 文件来打开该文件。 -2. Edit the `text` field of the first haiku to personalize the application with your own haiku. +2. 编辑第一个俳句的 `text` 字段,从而使用自己的俳句个性化应用程序。 -3. Go back to the running application tab in your browser and refresh to see your changes. +3. 返回到浏览器中正在运行的应用程序选项卡,然后刷新以查看所做的更改。 - {% octicon "light-bulb" aria-label="The lightbulb icon" %} If you've closed the tab, open the Ports panel and click the **Open in browser** icon for the running port. + {% octicon "light-bulb" aria-label="The lightbulb icon" %} 如果已关闭选项卡,请打开“端口”面板,然后针对运行的端口单击“在浏览器中打开”图标。 - ![Port Forwarding Panel](/assets/images/help/codespaces/quickstart-forward-port.png) + ![端口转发面板](/assets/images/help/codespaces/quickstart-forward-port.png) -## Committing and pushing your changes +## 提交和推送更改 -Now that you've made a few changes, you can use the integrated terminal or the source view to publish your work to a new repository. +现在,你已经进行了一些更改,可以使用集成终端或源视图将工作发布到新的存储库。 {% data reusables.codespaces.source-control-display-dark %} -1. To stage your changes, click **+** next to the `haikus.json` file, or next to **Changes** if you've changed multiple files and you want to stage them all. +1. 若要暂存更改,请单击 `haikus.json` 文件旁边的 +,如果你更改了多个文件并希望全部暂存,请单击“更改”旁边的按钮 。 - ![Source control side bar with staging button highlighted](/assets/images/help/codespaces/codespaces-commit-stage.png) + ![突出显示的暂存按钮的源代码管理侧栏](/assets/images/help/codespaces/codespaces-commit-stage.png) -2. To commit your staged changes, type a commit message describing the change you've made, then click **Commit**. +2. 若要提交暂存更改,请键入描述所做更改的提交消息,然后单击“提交”。 - ![Source control side bar with a commit message](/assets/images/help/codespaces/vscode-commit-button.png) + ![包含提交消息的源代码管理侧栏](/assets/images/help/codespaces/vscode-commit-button.png) -3. Click **Publish Branch**. +3. 单击“发布分支”。 - ![Screenshot of the "Publish branch" button in VS Code](/assets/images/help/codespaces/vscode-publish-branch-button.png) + ![VS Code 中“发布分支”按钮的屏幕截图](/assets/images/help/codespaces/vscode-publish-branch-button.png) -4. In the "Repository Name" dropdown, type a name for your new repository, then select **Publish to {% data variables.product.company_short %} private repository** or **Publish to {% data variables.product.company_short %} public repository**. +4. 在“存储库名称”下拉列表中,键入新存储库的名称,然后选择“发布到 {% data variables.product.company_short %} 专用存储库”或“发布到 {% data variables.product.company_short %} 公共存储库”。 - ![Screenshot of the "Repository Name" dropdown in VS Code](/assets/images/help/codespaces/choose-new-repository.png) + ![VS Code 中“存储库名称”下拉列表的屏幕截图](/assets/images/help/codespaces/choose-new-repository.png) - The owner of the new repository will be the {% data variables.product.prodname_dotcom %} account with which you created the codespace. -5. In the pop-up that appears in the lower right corner of the editor, click **Open on {% data variables.product.company_short %}** to view the new repository on {% data variables.product.prodname_dotcom_the_website %}. In the new repository, view the `haikus.json` file and check that the change you made in your codespace has been successfully pushed to the repository. + 新存储库的所有者将是创建 codespace 时所使用的 {% data variables.product.prodname_dotcom %} 帐户。 +5. 在编辑器右下角显示的弹出窗口中,单击“在 {% data variables.product.company_short %} 上打开”,查看 {% data variables.product.prodname_dotcom_the_website %} 上的新存储库。 在新存储库中,查看 `haikus.json` 文件,并检查 codespace 中所做的更改是否已成功推送到存储库。 - ![Screenshot of the "Open in GitHub" pop-up in VS Code](/assets/images/help/codespaces/open-on-github.png) + ![VS Code 中“在 GitHub 中打开”弹出窗口的屏幕截图](/assets/images/help/codespaces/open-on-github.png) -## Personalizing with an extension +## 使用扩展进行个性化设置 -When you connect to a codespace using the browser, or the {% data variables.product.prodname_vscode %} desktop application, you can access the Visual Studio Code Marketplace directly from the editor. For this example, you'll install a {% data variables.product.prodname_vscode_shortname %} extension that alters the theme, but you can install any extension that's useful for your workflow. +使用浏览器或 {% data variables.product.prodname_vscode %} 桌面应用程序连接到 codespace 时,可以直接从编辑器访问 Visual Studio Code 市场。 在本示例中,你将安装可更改主题的 {% data variables.product.prodname_vscode_shortname %} 扩展,但也可以安装对工作流程有用的任何扩展。 -1. In the left sidebar, click the Extensions icon. -1. In the search bar, type `fairyfloss` and click **Install**. +1. 在左侧栏中,单击扩展图标。 +1. 在搜索栏中,键入 `fairyfloss` 并单击“安装”。 - ![Add an extension](/assets/images/help/codespaces/add-extension.png) + ![添加扩展](/assets/images/help/codespaces/add-extension.png) -1. Select the `fairyfloss` theme by selecting it from the list. +1. 从列表中选择 `fairyfloss` 主题。 - ![Select the fairyfloss theme](/assets/images/help/codespaces/fairyfloss.png) + ![选择 fairyfloss 主题](/assets/images/help/codespaces/fairyfloss.png) -If you are using a codespace in the browser, or in the {% data variables.product.prodname_vscode %} desktop application, and you have [Settings Sync](https://code.visualstudio.com/docs/editor/settings-sync) turned on, any changes you make to your editor setup in the current codespace, such as changing your theme or keyboard bindings, are automatically synced to any instances of {% data variables.product.prodname_vscode %} that are signed into your {% data variables.product.prodname_dotcom %} account and to any other codespaces you create. +如果你在浏览器或 {% data variables.product.prodname_vscode %} 桌面应用程序中使用 codespace,并且已打开[“设置同步”](https://code.visualstudio.com/docs/editor/settings-sync),则在当前 codespace 中对编辑器设置所做的任何更改(例如更改主题或键盘绑定),将自动同步到已登录到 {% data variables.product.prodname_dotcom %} 帐户的任何 {% data variables.product.prodname_vscode %} 实例以及你创建的任何其他 codespace 中。 -## Next steps +## 后续步骤 -You've successfully created, personalized, and run your first application within a codespace but there's so much more to explore! Here are some helpful resources for taking your next steps with {% data variables.product.prodname_github_codespaces %}. +您已经成功创建、个性化并在代码空间中运行了第一个应用程序,但还有很多需要探索的地方! 以下是一些有用的资源,可以帮助你对 {% data variables.product.prodname_github_codespaces %} 执行后续步骤。 -* "[Deep dive](/codespaces/getting-started/deep-dive)": This quickstart presented some of the features of {% data variables.product.prodname_github_codespaces %}. The deep dive looks at these areas from a technical standpoint. -* "[Add a dev container configuration to your repository](/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces)": These guides provide information on setting up your repository to use {% data variables.product.prodname_github_codespaces %} with specific languages. -* "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)": This guide provides details on creating a custom configuration for {% data variables.product.prodname_codespaces %} for your project. +* “[深入探讨](/codespaces/getting-started/deep-dive)”:本快速入门介绍了 {% data variables.product.prodname_github_codespaces %} 的一些功能。 从技术角度深入探讨这些领域。 +* “[将开发容器配置添加到存储库](/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces)”:这些指南提供有关设置存储库以将 {% data variables.product.prodname_github_codespaces %} 用于特定语言的信息。 +* “[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)”:该指南提供有关创建用于项目的 {% data variables.product.prodname_codespaces %} 的自定义配置的详细信息。 -## Further reading +## 延伸阅读 -* "[Enabling {% data variables.product.prodname_github_codespaces %} for your organization](/codespaces/managing-codespaces-for-your-organization/enabling-github-codespaces-for-your-organization)" -* "[Using {% data variables.product.prodname_github_codespaces %} in {% data variables.product.prodname_vscode %}](/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code)" -* "[Using {% data variables.product.prodname_github_codespaces %} in your JetBrains IDE](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide)" -* "[Using {% data variables.product.prodname_github_codespaces %} with {% data variables.product.prodname_cli %}](/codespaces/developing-in-codespaces/using-github-codespaces-with-github-cli)" -* "[Setting your default editor for {% data variables.product.prodname_github_codespaces %}](/codespaces/customizing-your-codespace/setting-your-default-editor-for-github-codespaces)." -* "[Managing the cost of {% data variables.product.prodname_github_codespaces %} in your organization](/codespaces/managing-codespaces-for-your-organization/managing-the-cost-of-github-codespaces-in-your-organization)" +* “[为组织启用 {% data variables.product.prodname_github_codespaces %}](/codespaces/managing-codespaces-for-your-organization/enabling-github-codespaces-for-your-organization)” +* “[使用 {% data variables.product.prodname_vscode %} 中的 {% data variables.product.prodname_github_codespaces %}](/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code)” +* “[在 JetBrains IDE 中使用 {% data variables.product.prodname_github_codespaces %}](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide)” +* “[将 {% data variables.product.prodname_github_codespaces %} 与 {% data variables.product.prodname_cli %} 配合使用](/codespaces/developing-in-codespaces/using-github-codespaces-with-github-cli)” +* “[为 {% data variables.product.prodname_github_codespaces %} 设置默认编辑器](/codespaces/customizing-your-codespace/setting-your-default-editor-for-github-codespaces)”。 +* “[管理组织中的 {% data variables.product.prodname_github_codespaces %} 成本](/codespaces/managing-codespaces-for-your-organization/managing-the-cost-of-github-codespaces-in-your-organization)” diff --git a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/enabling-github-codespaces-for-your-organization.md b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/enabling-github-codespaces-for-your-organization.md index 914857fdef..f9d93fe877 100644 --- a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/enabling-github-codespaces-for-your-organization.md +++ b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/enabling-github-codespaces-for-your-organization.md @@ -1,8 +1,8 @@ --- -title: Enabling GitHub Codespaces for your organization +title: 为组织启用 GitHub Codespaces shortTitle: 'Enable {% data variables.product.prodname_codespaces %}' -intro: "You can control which users in your organization can use {% data variables.product.prodname_github_codespaces %} at the organization's expense." -permissions: "To alter an organization's billing settings, you must be an organization owner." +intro: '你可以控制组织中的哪些用户可以使用 {% data variables.product.prodname_github_codespaces %}(费用由组织承担)。' +permissions: 'To alter an organization''s billing settings, you must be an organization owner.' redirect_from: - /codespaces/managing-codespaces-for-your-organization/managing-user-permissions-for-your-organization - /codespaces/managing-codespaces-for-your-organization/enabling-codespaces-for-your-organization @@ -14,70 +14,69 @@ topics: - Codespaces - Billing - Administrator +ms.openlocfilehash: 992d744e04ae00db4d760b59a9d08d1700846998 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158899' --- +## 关于为组织启用 {% data variables.product.prodname_github_codespaces %} -## About enabling {% data variables.product.prodname_github_codespaces %} for your organization +组织所有者可以控制组织中的哪些用户可以创建和使用 codespace(费用由组织承担)。 有关定价的信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)”。 -Organization owners can control which users in your organization can create and use codespaces at the organization's expense. For information about pricing, see "[About billing for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)." +只有可以将更改推送到存储库或创建存储库分支的人才能为该存储库创建 codespace。 若要允许人们为组织拥有的存储库创建 codespace,必须: -Only people who can either push changes to a repository, or fork the repository, can create a codespace for that repository. To allow people to create codespaces for repositories owned by your organization, you must: +- 确保用户对他们要在其中使用代码空间的存储库至少具有写入权限。 有关详细信息,请参阅“[管理有权访问存储库的团队和人员](/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/managing-teams-and-people-with-access-to-your-repository)”。 +- 确保您的组织未启用 IP 地址允许列表。 有关详细信息,请参阅 {% data variables.product.prodname_ghe_cloud %} 文档中的“[管理组织允许的 IP 地址](/{% ifversion fpt %}enterprise-cloud@latest/{% endif %}organizations/keeping-your-organization-secure/managing-allowed-ip-addresses-for-your-organization){% ifversion fpt %}”。{% else %}."{% endif %} -- Ensure that users have at least write access to the repositories where they want to use a codespace. For more information, see "[Managing teams and people with access to your repository](/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/managing-teams-and-people-with-access-to-your-repository)." -- Ensure that your organization does not have an IP address allow list enabled. For more information, see "[Managing allowed IP addresses for your organization](/{% ifversion fpt %}enterprise-cloud@latest/{% endif %}organizations/keeping-your-organization-secure/managing-allowed-ip-addresses-for-your-organization){% ifversion fpt %}" in the {% data variables.product.prodname_ghe_cloud %} documentation.{% else %}."{% endif %} +若要允许人们创建会对组织进行计费的 codespace,必须: -To allow people to create codespaces for which your organization will be billed, you must: +- [设置支出限制](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces) +- [选择可以创建会对组织进行计费的 codespace 的人员](#choose-who-can-create-codespaces-that-are-billed-to-your-organization) -- [Set a spending limit](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces) -- [Choose who can create codespaces that are billed to your organization](#choose-who-can-create-codespaces-that-are-billed-to-your-organization) +{% ifversion fpt %} {% note %} -{% ifversion fpt %} -{% note %} +注意:如果你是经过验证的教师或老师,则必须从 {% data variables.product.prodname_classroom %} 启用 {% data variables.product.prodname_github_codespaces %} 来使用 {% data variables.product.prodname_codespaces %} 教育权益。 有关详细信息,请参阅“[将 {% data variables.product.prodname_github_codespaces %} 与 {% data variables.product.prodname_classroom %} 配合使用](/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide/using-github-codespaces-with-github-classroom#about-the-codespaces-education-benefit-for-verified-teachers)”。 -**Note:** If you are a verified educator or a teacher, you must enable {% data variables.product.prodname_github_codespaces %} from a {% data variables.product.prodname_classroom %} to use your {% data variables.product.prodname_codespaces %} Education benefit. For more information, see "[Using {% data variables.product.prodname_github_codespaces %} with {% data variables.product.prodname_classroom %}](/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide/using-github-codespaces-with-github-classroom#about-the-codespaces-education-benefit-for-verified-teachers)." +{% endnote %} {% endif %} -{% endnote %} -{% endif %} +默认情况下,代码空间只能访问从中创建它的存储库。 如果希望组织中的 codespace 能够访问 codespace 创建者可以访问的其他组织存储库,请参阅“[管理组织 codespace 的存储库访问](/codespaces/managing-codespaces-for-your-organization/managing-repository-access-for-your-organizations-codespaces)”。 -By default, a codespace can only access the repository from which it was created. If you want codespaces in your organization to be able to access other organization repositories that the codespace creator can access, see "[Managing repository access for your organization's codespaces](/codespaces/managing-codespaces-for-your-organization/managing-repository-access-for-your-organizations-codespaces)." +## 选择可以创建会对组织进行计费的 codespace 的人员 -## Choose who can create codespaces that are billed to your organization +{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} {% data reusables.organizations.click-codespaces %} +1. 在“计费”下,择以下选项之一: -{% data reusables.profile.access_org %} -{% data reusables.profile.org_settings %} -{% data reusables.organizations.click-codespaces %} -1. Under "Billing," select one of the following options: + * 已禁用 - 不会因使用 codespace 对组织进行计费。 为组织存储库创建的 {% data variables.product.prodname_codespaces %} 会向创建它们的个人用户进行计费。 + * 所选成员 - 由所选成员为组织存储库创建的 {% data variables.product.prodname_codespaces %} 会对组织进行计费。 + * 所有成员 - 由组织成员为组织存储库创建的 {% data variables.product.prodname_codespaces %} 会对组织进行计费。 + * 所有成员和外部协作者 - 由组织成员和外部协作者为组织存储库创建的 {% data variables.product.prodname_codespaces %} 会对组织进行计费。 - * **Disabled** - Your organization will not be charged for codespace usage. {% data variables.product.prodname_codespaces %} created for your organization's repositories will be billed to the individual users who create them. - * **Selected members** - {% data variables.product.prodname_codespaces %} created for your organization's repositories by selected members will be billed to the organization. - * **All members** - {% data variables.product.prodname_codespaces %} created for your organization's repositories by members of your organization will be billed to the organization. - * **All members and outside collaborators** - {% data variables.product.prodname_codespaces %} created for your organization's repositories by organization members and outside collaborators will be billed to the organization. - - ![Radio buttons for "Billing"](/assets/images/help/codespaces/codespaces-org-billing-settings.png) + ![“计费”的单选按钮](/assets/images/help/codespaces/codespaces-org-billing-settings.png) {% note %} - **Note:** When you select **All members and outside collaborators**, all outside collaborators who have been added to specific repositories can create and use {% data variables.product.prodname_codespaces %} for those repositories, and your organization will be billed for this usage. For more information on managing outside collaborators, see "[About outside collaborators](/organizations/managing-access-to-your-organizations-repositories/adding-outside-collaborators-to-repositories-in-your-organization#about-outside-collaborators)." + 注意:选择“所有成员和外部协作者”时,所有已添加到特定存储库的外部协作者都可以对这些存储库创建和使用 {% data variables.product.prodname_codespaces %},这种使用会对组织进行计费。 有关管理外部协作者的详细信息,请参阅“[关于外部协作者](/organizations/managing-access-to-your-organizations-repositories/adding-outside-collaborators-to-repositories-in-your-organization#about-outside-collaborators)”。 {% endnote %} -1. Click **Save**. -1. If you chose **Selected members**, an input box is displayed for you to enter the names of users you want to select. +1. 单击“ **保存**”。 +1. 如果选择了“所选成员”,则会显示一个输入框,以供你输入要选择的用户的名称。 - ![Input box for selecting users](/assets/images/help/codespaces/codespaces-org-billing-add-users.png) + ![用于选择用户的输入框](/assets/images/help/codespaces/codespaces-org-billing-add-users.png) -## Disabling {% data variables.product.prodname_codespaces %} for your organization +## 为组织禁用 {% data variables.product.prodname_codespaces %} -You can prevent the creation and use of codespaces billable to your organization. +可以阻止创建和使用可对组织进行计费的 codespace。 {% data reusables.codespaces.codespaces-disabling-org-billing %} -{% data reusables.profile.access_org %} -{% data reusables.profile.org_settings %} -{% data reusables.organizations.click-codespaces %} -1. Under "Billing," select **Disabled**. +{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} {% data reusables.organizations.click-codespaces %} +1. 在“计费”下,选择“已禁用”。 -## Setting a spending limit +## 设置支出限制 {% data reusables.codespaces.codespaces-spending-limit-requirement %} -For information on managing and changing your account's spending limit, see "[Managing your spending limit for {% data variables.product.prodname_codespaces %}](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces)." +有关管理和更改帐户支出限制的信息,请参阅“[管理 {% data variables.product.prodname_codespaces %} 的支出限制](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces)”。 diff --git a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/index.md b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/index.md index 05bf754d62..82e9563943 100644 --- a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/index.md +++ b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/index.md @@ -1,8 +1,8 @@ --- -title: Managing GitHub Codespaces for your organization +title: 为组织启用 GitHub Codespaces allowTitleToDifferFromFilename: true shortTitle: Managing your organization -intro: 'You can manage and review how users in your organization can use {% data variables.product.prodname_github_codespaces %}.' +intro: '您可以管理和审查您组织中的用户如何使用 {% data variables.product.prodname_github_codespaces %}。' versions: fpt: '*' ghec: '*' @@ -20,5 +20,11 @@ children: - /restricting-the-visibility-of-forwarded-ports - /restricting-the-idle-timeout-period - /restricting-the-retention-period-for-codespaces +ms.openlocfilehash: 7b8b9211a8bcafdcfb3fb2b037ea6362e8ecb27f +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158635' --- - + diff --git a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/listing-the-codespaces-in-your-organization.md b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/listing-the-codespaces-in-your-organization.md index 10e2e88b4e..bbac9afef0 100644 --- a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/listing-the-codespaces-in-your-organization.md +++ b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/listing-the-codespaces-in-your-organization.md @@ -1,7 +1,7 @@ --- -title: Listing the codespaces in your organization +title: 列出组织中的 codespace shortTitle: List organization codespaces -intro: 'You can list all of the currently active or stopped codespaces for your organization.' +intro: 可以列出组织当前处于活动状态或已停止的所有 codespace。 permissions: 'To list all of the current codespaces for your organization, you must be an organization owner.' versions: fpt: '*' @@ -10,31 +10,36 @@ type: how_to topics: - Codespaces - Administrator +ms.openlocfilehash: e3d475560c76449ed20b70fbce29ef6273f788fc +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158627' --- +## 概述 -## Overview +作为组织所有者,可以列出组织当前处于活动状态和已停止的所有 codespace。 你可能想要执行此操作来检查用户正在创建多少 codespace,以确保不会产生不必要的成本。 有关定价的信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)”。 -As an organization owner, you can list all of the currently active and stopped codespaces for your organization. You might want to do this to check how many codespaces users are creating, to make sure they aren't incurring unnecessary costs. For information about pricing, see "[About billing for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)." +列出组织的 codespace 的最简单方法是使用 {% data variables.product.prodname_cli %}。 还可以使用 REST API,该 API 提供有关每个 codespace 的详细信息。 -The easiest way to list the codespaces for an organization is by using {% data variables.product.prodname_cli %}. You can also use the REST API, which provides more information about each codespace. +有关如何查看组织或企业当前总的 {% data variables.product.prodname_codespaces %} 使用情况并生成详细报告的信息,请参阅“[查看 {% data variables.product.prodname_github_codespaces %} 使用情况](/billing/managing-billing-for-github-codespaces/viewing-your-github-codespaces-usage)”。 -For information on how to see the current total {% data variables.product.prodname_codespaces %} usage for your organization or enterprise, and generate a detailed report, see "[Viewing your {% data variables.product.prodname_github_codespaces %} usage](/billing/managing-billing-for-github-codespaces/viewing-your-github-codespaces-usage)." +### 使用 {% data variables.product.prodname_cli %} 列出 codespace -### Using {% data variables.product.prodname_cli %} to list codespaces - -To list all of the current codespaces for a specified organization, use the following command. +若要列出指定组织的所有当前 codespace,请使用以下命令。 ```shell{:copy} gh codespace list --org ORGANIZATION ``` -This command returns a list that includes the following information for each codespace: - - The name and display name - - The user who created the codespace - - The repository and branch - - The current state of the codespace +此命令返回一个列表,其中包含每个 codespace 的以下信息: + - 名称和显示名称 + - 创建 codespace 的用户 + - 存储库和分支 + - codespace 的当前状态 -To list all of the current codespaces for an organization that were created by a specific user, use the following command. +若要列出由特定用户创建的组织的所有当前 codespace,请使用以下命令。 ```shell{:copy} gh codespace list --org ORGANIZATION --user USER @@ -42,12 +47,12 @@ gh codespace list --org ORGANIZATION --user USER {% note %} -**Note**: In the above commands, replace `ORGANIZATION` with the name of the organization you are querying. You must be an owner of the organization. +**注意**:在上述命令中,将 `ORGANIZATION` 替换为要查询的组织的名称。 你必须是组织的所有者。 {% endnote %} -### Using the REST API to list codespaces +### 使用 REST API 列出 codespace -You can use the `/orgs/{org}/codespaces` API endpoint as an alternative method of listing the current codespaces for an organization. This returns more information than {% data variables.product.prodname_cli %}; for example, the machine type details. +可以将 `/orgs/{org}/codespaces` API 终结点用作列出组织当前 codespace 的替代方法。 这将返回比 {% data variables.product.prodname_cli %} 更详细的信息;例如,计算机类型详细信息。 -For more information about this endpoint, see "[Codespaces organizations](/rest/codespaces/organizations#list-codespaces-for-the-organization)." +有关此终结点的详细信息,请参阅“[Codespaces 组织](/rest/codespaces/organizations#list-codespaces-for-the-organization)”。 diff --git a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/managing-repository-access-for-your-organizations-codespaces.md b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/managing-repository-access-for-your-organizations-codespaces.md index 639cc2acac..264f0c6b79 100644 --- a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/managing-repository-access-for-your-organizations-codespaces.md +++ b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/managing-repository-access-for-your-organizations-codespaces.md @@ -1,7 +1,7 @@ --- -title: Managing repository access for your organization's codespaces +title: 管理组织代码空间的存储库访问 shortTitle: Repository access -intro: 'You can manage the repositories in your organization that {% data variables.product.prodname_github_codespaces %} can access.' +intro: '你可以管理 {% data variables.product.prodname_github_codespaces %} 可以访问的组织中的存储库。' permissions: 'To manage access and security for {% data variables.product.prodname_github_codespaces %} for an organization, you must be an organization owner.' versions: fpt: '*' @@ -15,26 +15,29 @@ redirect_from: - /codespaces/managing-codespaces-for-your-organization/managing-access-and-security-for-your-organizations-codespaces - /github/developing-online-with-codespaces/managing-access-and-security-for-codespaces - /codespaces/working-with-your-codespace/managing-access-and-security-for-codespaces +ms.openlocfilehash: 9fdec24104a61170977053195446db0b4cf0a62f +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159525' --- - {% warning %} -**Deprecation note**: The access and security setting described below is now deprecated and is documented here for reference only. To enable expanded access to other repositories, add the requested permissions to your `devcontainer.json` configuration file. For more information, see "[Managing access to other repositories within your codespace](/codespaces/managing-your-codespaces/managing-repository-access-for-your-codespaces)." +**停用说明**:下方描述的访问和安全设置现已停用,此处记录仅为参考。 若要启用对其他存储库的扩展访问权限,请将请求的权限添加到 `devcontainer.json` 配置文件。 有关详细信息,请参阅“[管理对 codespace 内其他存储库的访问权限](/codespaces/managing-your-codespaces/managing-repository-access-for-your-codespaces)”。 {% endwarning %} -By default, a codespace can only access the repository where it was created. When you enable access and security for a repository owned by your organization, any codespaces that are created for that repository will also have read permissions to all other repositories the organization owns and the codespace creator has permissions to access. If you want to restrict the repositories a codespace can access, you can limit it to either the repository where the codespace was created, or to specific repositories. You should only enable access and security for repositories you trust. +默认情况下,代码空间只能访问创建它的仓库。 当您为组织拥有的存储库启用访问和安全性时,为该存储库创建的任何代码空间也将对组织拥有的所有其他存储库具有读取权限,并且代码空间创建者具有访问权限。 如果要限制代码空间可以访问的存储库,可以将其限制为创建代码空间的存储库或特定存储库。 您应该只对您信任的仓库启用访问和安全。 -To manage which users in your organization can use {% data variables.product.prodname_github_codespaces %}, see "[Enabling {% data variables.product.prodname_github_codespaces %} for your organization](/codespaces/managing-codespaces-for-your-organization/enabling-github-codespaces-for-your-organization#enable-codespaces-for-users-in-your-organization)." +要管理组织中的哪些用户可以使用 {% data variables.product.prodname_github_codespaces %},请参阅“[为组织启用 {% data variables.product.prodname_github_codespaces %}](/codespaces/managing-codespaces-for-your-organization/enabling-github-codespaces-for-your-organization#enable-codespaces-for-users-in-your-organization)”。 -{% data reusables.profile.access_org %} -{% data reusables.profile.org_settings %} -{% data reusables.organizations.click-codespaces %} -1. Under "Access and security", select the setting you want for your organization. - ![Radio buttons to manage trusted repositories](/assets/images/help/settings/codespaces-org-access-and-security-radio-buttons.png) -1. If you chose "Selected repositories", select the dropdown menu, then click a repository to allow the repository's codespaces to access other repositories owned by your organization. Repeat for all repositories whose codespaces you want to access other repositories. - !["Selected repositories" dropdown menu](/assets/images/help/settings/codespaces-access-and-security-repository-drop-down.png) +{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} {% data reusables.organizations.click-codespaces %} +1. 在“Access and security(访问和安全)”下,为组织选择所需的设置。 + ![管理受信任存储库的单选按钮](/assets/images/help/settings/codespaces-org-access-and-security-radio-buttons.png) +1. 如果选择了“所选存储库”,请选择下拉菜单,然后单击一个存储库,以允许该存储库的 codespace 访问组织拥有的其他存储库。 对于您要允许其代码空间访问其他仓库的所有仓库重复此操作。 + ![“所选存储库”下拉菜单](/assets/images/help/settings/codespaces-access-and-security-repository-drop-down.png) -## Further reading +## 延伸阅读 -- "[Managing repository access for your codespaces](/codespaces/managing-your-codespaces/managing-repository-access-for-your-codespaces)" +- [管理 codespace 的存储库访问](/codespaces/managing-your-codespaces/managing-repository-access-for-your-codespaces) diff --git a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/managing-the-cost-of-github-codespaces-in-your-organization.md b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/managing-the-cost-of-github-codespaces-in-your-organization.md new file mode 100644 index 0000000000..2cca9f5b16 --- /dev/null +++ b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/managing-the-cost-of-github-codespaces-in-your-organization.md @@ -0,0 +1,75 @@ +--- +title: 管理组织中的 GitHub Codespaces 成本 +shortTitle: Manage Codespaces costs +intro: '你可以检查 {% data variables.product.prodname_github_codespaces %} 使用情况并设置使用限制。' +permissions: 'To manage billing for {% data variables.product.prodname_github_codespaces %} for an organization, you must be an organization owner or a billing manager.' +versions: + fpt: '*' + ghec: '*' +type: reference +topics: + - Codespaces + - Billing +redirect_from: + - /codespaces/managing-codespaces-for-your-organization/managing-billing-for-codespaces-in-your-organization + - /codespaces/managing-codespaces-for-your-organization/managing-billing-for-github-codespaces-in-your-organization +ms.openlocfilehash: f11c6e22fa8a233fd4429b91390d25471ad17e6d +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158707' +--- +## 概述 + +组织将根据其 {% data variables.product.prodname_github_codespaces %} 的计算和存储使用情况计费。 本文介绍组织所有者管理这些成本的方式。 + +要了解 {% data variables.product.prodname_github_codespaces %} 定价,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#codespaces-pricing)”。 + +## 支出限制 + +可以为组织的 {% data variables.product.prodname_github_codespaces %} 设置支出限制。 此限制适用于 {% data variables.product.prodname_github_codespaces %} 的总计算和存储成本。 有关详细信息,请参阅“[管理 {% data variables.product.prodname_github_codespaces %} 的支出限制](/billing/managing-billing-for-github-codespaces/managing-the-spending-limit-for-github-codespaces)”。 + +- 计算使用情况: 这是所有 {% data variables.product.prodname_github_codespaces %} 实例(“codespaces”)在计费月份处于活动状态的总时间。 + +- 存储使用情况:出于 {% data variables.product.prodname_github_codespaces %} 计费目的,这包括你帐户中所有 codespace 和预生成使用的所有文件。 这包括克隆的存储库、配置文件和扩展等资源。 + +可以检查当前计费月份的 {% data variables.product.prodname_github_codespaces %} 的计算和存储使用情况。 有关信息,请参阅“[查看 {% data variables.product.prodname_github_codespaces %} 使用情况](/billing/managing-billing-for-github-codespaces/viewing-your-github-codespaces-usage)”。 + +{% note %} + +注意:{% data variables.product.prodname_github_codespaces %} 预生成是使用 {% data variables.product.prodname_actions %} 创建和更新的。 这可能会给 {% data variables.product.prodname_actions %} 带来可计费成本。 可以为 {% data variables.product.prodname_actions %} 设置支出限额。 有关详细信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#billing-for-codespaces-prebuilds)”和“[管理 {% data variables.product.prodname_actions %} 的支出限制](/billing/managing-billing-for-github-actions/managing-your-spending-limit-for-github-actions)”。 生成的预生成存储的费率与 codespace 相同,并包含在 {% data variables.product.prodname_github_codespaces %} 支出限制中。 + +{% endnote %} + +## 禁用或限制 {% data variables.product.prodname_codespaces %} + +你可以禁用会对组织进行计费的所有 {% data variables.product.prodname_github_codespaces %} 使用。 或者,你可以指定哪些组织成员或协作者可以使用 {% data variables.product.prodname_codespaces %}(费用由组织承担)。 有关详细信息,请参阅“[为组织启用 {% data variables.product.prodname_github_codespaces %}](/codespaces/managing-codespaces-for-your-organization/enabling-github-codespaces-for-your-organization)”。 + +{% data reusables.codespaces.codespaces-disabling-org-billing %} + +可以配置可从为特定存储库创建的 codespace 访问哪些存储库。 有关详细信息,请参阅“[管理对 codespace 内其他存储库的访问权限](/codespaces/managing-your-codespaces/managing-repository-access-for-your-codespaces)”。 + +可以限制可用于从组织拥有的存储库创建的 codespace 的计算机类型选择。 这使你可以防止人们使用资源过多的计算机作为其 codespace,产生不必要的费用。 有关详细信息,请参阅“[限制对计算机类型的访问](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)”。 + +可以设置最大空闲超时约束,以限制人们为可对你的组织计费的 codespace 设置的最大超时。 通过在较短的超时期后停止活动 codespace,可以减少以空闲状态运行的 codespace 生成的计算使用费用。 有关详细信息,请参阅“[限制空闲超时期限](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)”。 + +还可以限制停止的 codespace 在自动删除之前可以保持未使用状态的时间长度。 这可帮助降低 {% data variables.product.prodname_codespaces %} 的存储成本。 有关详细信息,请参阅“[限制 codespace 的保持期](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces)”。 + +为存储库设置预生成的存储库所有者可以通过将预生成配置为仅在选定区域中创建来降低预生成存储成本。 有关详细信息,请参阅“[配置预生成](/codespaces/prebuilding-your-codespaces/configuring-prebuilds#configuring-prebuilds)”。 + +## 删除未使用的代码空间 + +你的用户可以在 https://github.com/codespaces 中以及从 {% data variables.product.prodname_vscode %} 中删除他们自己的 codespace。 要减小 codespace 的大小,用户可以使用终端或从 {% data variables.product.prodname_vscode_shortname %} 中手动删除文件。 + +作为组织所有者,可以删除组织中的任何 codespace。 有关详细信息,请参阅“[删除 codespace](/codespaces/developing-in-codespaces/deleting-a-codespace#deleting-codespaces-in-your-organization)”。 + +{% note %} + +注意:Codespace 在停止后会自动删除,并在用户自定义天数内保持非活动状态。 有关详细信息,请参阅“[配置 codespace 的自动删除](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces)”。 作为组织所有者,你可以为组织拥有的 codespace 设置最大保持期。 这将替代用户的个人保持期设置。 有关详细信息,请参阅“[限制 codespace 的保持期](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces)”。 + +{% endnote %} + +## 延伸阅读 + +- “[列出组织中的 codespace](/codespaces/managing-codespaces-for-your-organization/listing-the-codespaces-in-your-organization)” diff --git a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types.md b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types.md index 6d19604ad4..acd9c942b4 100644 --- a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types.md +++ b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types.md @@ -1,7 +1,7 @@ --- -title: Restricting access to machine types +title: 限制对计算机类型的访问 shortTitle: Restrict machine types -intro: You can set constraints on the types of machines users can choose when they create codespaces in your organization. +intro: 你可以对用户在组织中创建 codespace 时可以选择的计算机类型设置约束。 permissions: 'To manage access to machine types for the repositories in an organization, you must be an owner of the organization.' versions: fpt: '*' @@ -9,82 +9,85 @@ versions: type: how_to topics: - Codespaces +ms.openlocfilehash: 202a2cf9f28a55514450415230686c0c0e94600f +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159155' --- +## 概述 -## Overview +通常,在创建代码空间时,系统会为将运行代码空间的计算机提供一系列规范。 您可以选择最适合您需求的计算机类型。 有关详细信息,请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)”。 -Typically, when you create a codespace you are offered a choice of specifications for the machine that will run your codespace. You can choose the machine type that best suits your needs. For more information, see "[Creating a codespace for a repository](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)." +如果您为使用 {% data variables.product.prodname_github_codespaces %} 付费,那么您选择的计算机类型将影响您的账单金额。 codespace 的计算成本与你选择的计算机类型中的处理器核心数成正比。 例如,在 16 核计算机上使用 codespace 一小时的计算成本是 2 核计算机的 8 倍。 有关定价的详细信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)”。 -If you pay for using {% data variables.product.prodname_github_codespaces %} then your choice of machine type will affect how much your are billed. The compute cost for a codespace is proportional to the number of processor cores in the machine type you choose. For example, the compute cost of using a codespace for an hour on a 16-core machine is eight times greater than a 2-core machine. For more information about pricing, see "[About billing for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)." +作为组织所有者,您可能希望对可用的计算机类型配置约束。 例如,如果组织中的工作不需要大量的计算能力或存储空间,则可以从用户可以选择的选项列表中删除资源丰富的计算机。 为此,可在组织的 {% data variables.product.prodname_github_codespaces %} 设置中定义一个或多个策略。 -As an organization owner, you may want to configure constraints on the types of machine that are available. For example, if the work in your organization doesn't require significant compute power or storage space, you can remove the highly resourced machines from the list of options that people can choose from. You do this by defining one or more policies in the {% data variables.product.prodname_github_codespaces %} settings for your organization. +### 设置计算机类型约束时的行为 -### Behavior when you set a machine type constraint +如果现有 codespace 不再符合你定义的策略,这些 codespace 将继续运行,直到它们停止或超时。当用户尝试恢复 codespace 时,系统会显示一条消息,告知他们目前选择的计算机类型已不再可供此组织使用,并提示他们选择备用计算机类型。 -If there are existing codespaces that no longer conform to a policy you have defined, these codespaces will continue to operate until they are stopped or time out. When the user attempts to resume the codespace they are shown a message telling them that the currenly selected machine type is no longer allowed for this organization and prompting them to choose an alternative machine type. - -If you remove higher specification machine types that are required by the {% data variables.product.prodname_github_codespaces %} configuration for an individual repository in your organization, then it won't be possible to create a codespace for that repository. When someone attempts to create a codespace they will see a message telling them that there are no valid machine types available that meet the requirements of the repository's {% data variables.product.prodname_github_codespaces %} configuration. +如果删除组织中单个存储库的 {% data variables.product.prodname_github_codespaces %} 配置所需的更高规范的计算机类型,则无法为该存储库创建 codespace。 当有人尝试创建 codespace 时,他们将看到一条消息,告诉他们没有有效的计算机类型可以满足存储库 {% data variables.product.prodname_github_codespaces %} 配置的要求。 {% note %} -**Note**: Anyone who can edit the `devcontainer.json` configuration file in a repository can set a minimum specification for machines that can be used for codespaces for that repository. For more information, see "[Setting a minimum specification for codespace machines](/codespaces/setting-up-your-project-for-codespaces/setting-a-minimum-specification-for-codespace-machines)." +注意:任何可以在存储库中编辑 `devcontainer.json` 配置文件的人员都可以为计算机设置可用于该存储库的 codespace 的最低规范。 有关详细信息,请参阅“[为 codespace 计算机设置最低规范](/codespaces/setting-up-your-project-for-codespaces/setting-a-minimum-specification-for-codespace-machines)”。 {% endnote %} -If setting a policy for machine types prevents people from using {% data variables.product.prodname_github_codespaces %} for a particular repository there are two options: +如果为计算机类型设置策略会阻止用户对特定存储库使用 {% data variables.product.prodname_github_codespaces %},则有两种选择: -* You can adjust your policies to specifically remove the restrictions from the affected repository. -* Anyone who has a codespace that they can no longer access, because of the new policy, can export their codespace to a branch. This branch will contain all of their changes from the codespace. They can then open a new codespace on this branch with a compliant machine type or work on this branch locally. For more information, see "[Exporting changes to a branch](/codespaces/troubleshooting/exporting-changes-to-a-branch)." +* 您可以调整策略以专门从受影响的存储库中删除限制。 +* 由于新策略,任何拥有无法再访问的代码空间的人都可以将其代码空间导出到分支。 此分支将包含它们从代码空间所做的所有更改。 然后,他们可以使用兼容的计算机类型在此分支上打开新的代码空间,或者在本地处理此分支。 有关详细信息,请参阅“[将更改导出到分支](/codespaces/troubleshooting/exporting-changes-to-a-branch)”。 -### Setting organization-wide and repository-specific policies +### 设置组织范围和存储库特定的策略 -When you create a policy you choose whether it applies to all repositories in your organization, or only to specified repositories. If you set an organization-wide policy then any policies you set for individual repositories must fall within the restriction set at the organization level. Adding policies makes the choice of machine more, not less, restrictive. +创建策略时,您可以选择是将其应用于组织中的所有存储库,还是仅应用于指定的存储库。 如果设置了组织范围的策略,则为各个存储库设置的任何策略都必须在组织级别设置的限制范围内。 添加策略会使计算机的选择受到限制更多,而不是更少。 -For example, you could create an organization-wide policy that restricts the machine types to either 2 or 4 cores. You can then set a policy for Repository A that restricts it to just 2-core machines. Setting a policy for Repository A that restricted it to machines with 2, 4, or 8 cores would result in a choice of 2-core and 4-core machines only, because the organization-wide policy prevents access to 8-core machines. +例如,您可以创建一个组织范围的策略,将计算机类型限制为 2 核或 4 核。 然后,您可以为存储库 A 设置一个策略,将其限制为仅 2 核计算机。 为存储库 A 设置策略以将其限制为具有 2、4 或 8 核的计算机将导致仅选择 2 核和 4 核计算机,因为组织范围的策略会阻止访问 8 核计算机。 -If you add an organization-wide policy, you should set it to the largest choice of machine types that will be available for any repository in your organization. You can then add repository-specific policies to further restrict the choice. +如果添加组织范围的策略,则应将其设置为可用于组织中任何存储库的最大计算机类型选择范围。 然后,您可以添加特定于存储库的策略以进一步限制选择。 {% data reusables.codespaces.codespaces-org-policies-note %} -## Adding a policy to limit the available machine types +## 添加策略以限制可用的计算机类型 -{% data reusables.profile.access_org %} -{% data reusables.profile.org_settings %} -{% data reusables.codespaces.codespaces-org-policies %} -1. Click **Add constraint** and choose **Machine types**. +{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} {% data reusables.codespaces.codespaces-org-policies %} +1. 单击“添加约束”并选择“计算机类型” 。 - ![Screenshot of the 'Add constraint' dropdown menu](/assets/images/help/codespaces/add-constraint-dropdown.png) + ![“添加约束”下拉菜单的屏幕截图](/assets/images/help/codespaces/add-constraint-dropdown.png) -1. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the constraint, then clear the selection of any machine types that you don't want to be available. +1. 单击 {% octicon "pencil" aria-label="The edit icon" %} 以编辑约束,然后清除您不希望可用的任何计算机类型的选择。 - ![Screenshot of the pencil icon for editing the constraint](/assets/images/help/codespaces/edit-machine-constraint.png) + ![用于编辑约束的铅笔图标的屏幕截图](/assets/images/help/codespaces/edit-machine-constraint.png) {% data reusables.codespaces.codespaces-policy-targets %} -1. If you want to add another constraint to the policy, click **Add constraint** and choose another constraint. For information about other constraints, see: - * "[Restricting the base image for codespaces](/codespaces/managing-codespaces-for-your-organization/restricting-the-base-image-for-codespaces)" - * "[Restricting the visibility of forwarded ports](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)" - * "[Restricting the idle timeout period](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)" - * "[Restricting the retention period for codespaces](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces)" -1. After you've finished adding constraints to your policy, click **Save**. +1. 如果要向策略添加另一个约束,请单击“添加约束”并选择另一个约束。 有关其他约束的信息,请参阅: + * [限制 codespace 的基础映像](/codespaces/managing-codespaces-for-your-organization/restricting-the-base-image-for-codespaces) + * [限制转发端口的可见性](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports) + * [限制空闲超时期限](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period) + * [限制 codespace 的保持期](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces) +1. 向策略添加完约束后,单击“保存”。 -The policy will be applied to all new codespaces that are billable to your organization. The machine type constraint is also applied to existing codespaces when someone attempts to restart a stopped codespace or reconnect to an active codespace. +策略将应用于对组织计费的所有新 codespace。 当有人尝试重启已停止的 codespace 或重新连接到活动 codespace 时,计算机类型约束也会应用于现有的 codespace。 -## Editing a policy +## 编辑策略 -You can edit an existing policy. For example, you may want to add or remove constraints to or from a policy. +可以编辑现有策略。 例如,你可能想要在策略中添加或移除约束。 -1. Display the "Codespace policies" page. For more information, see "[Adding a policy to limit the available machine types](#adding-a-policy-to-limit-the-available-machine-types)." -1. Click the name of the policy you want to edit. -1. Click the pencil icon ({% octicon "pencil" aria-label="The edit icon" %}) beside the "Machine types" constraint. -1. Make the required changes then click **Save**. +1. 显示“Codespace policies(代码空间策略)”页。 有关详细信息,请参阅“[添加策略以限制可用的计算机类型](#adding-a-policy-to-limit-the-available-machine-types)”。 +1. 单击要编辑的策略的名称。 +1. 单击“计算机类型”约束旁边的铅笔图标 ({% octicon "pencil" aria-label="The edit icon" %})。 +1. 执行所需更改,然后单击“保存”。 -## Deleting a policy +## 删除策略 -1. Display the "Codespace policies" page. For more information, see "[Adding a policy to limit the available machine types](#adding-a-policy-to-limit-the-available-machine-types)." -1. Click the delete button to the right of the policy you want to delete. +1. 显示“Codespace policies(代码空间策略)”页。 有关详细信息,请参阅“[添加策略以限制可用的计算机类型](#adding-a-policy-to-limit-the-available-machine-types)”。 +1. 单击要删除的策略右侧的删除按钮。 - ![Screenshot of the delete button for a policy](/assets/images/help/codespaces/policy-delete.png) + ![策略的“删除”按钮的屏幕截图](/assets/images/help/codespaces/policy-delete.png) -## Further reading +## 延伸阅读 -- "[Managing spending limits for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/managing-the-spending-limit-for-github-codespaces)" +- “[管理 {% data variables.product.prodname_github_codespaces %} 的支出限制](/billing/managing-billing-for-github-codespaces/managing-the-spending-limit-for-github-codespaces)” diff --git a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-base-image-for-codespaces.md b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-base-image-for-codespaces.md new file mode 100644 index 0000000000..4fc3ad0c5f --- /dev/null +++ b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-base-image-for-codespaces.md @@ -0,0 +1,103 @@ +--- +title: 限制 codespace 的基础映像 +shortTitle: Restrict base image +intro: 可以指定哪些基础映像可用于在组织内创建的新 codespace。 +permissions: 'To manage image constraints for an organization''s codespaces, you must be an owner of the organization.' +versions: + fpt: '*' + ghec: '*' +type: how_to +topics: + - Codespaces +ms.openlocfilehash: 1da438a680dd3e60c1deeec46a98fbcf48f84e5b +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158995' +--- +## 概述 + +创建 codespace 时,远程虚拟机上会自动创建 Docker 容器。 Docker 容器是通过 Docker 映像创建的。 映像实际上是 Docker 容器的模板,它确定了 codespace 提供的结果环境的许多方面。 + +可以在存储库的开发容器配置中指定映像,从而选择要用于 codespace 的映像。 例如,可以使用 `devcontainer.json` 文件中的 `image` 属性来执行此操作。 + +```json{:copy} +"image": "mcr.microsoft.com/vscode/devcontainers/javascript-node:18", +``` + +有关详细信息,请参阅 containers.dev 上的[开发容器规范](https://containers.dev/implementors/json_reference/)。 + +如果未在存储库的开发容器配置中指定映像,则使用默认映像。 默认映像包含许多常用语言和常用工具的运行时版本。 有关详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#using-the-default-dev-container-configuration)”。 + +作为组织所有者,你可以添加一个策略来限制哪些映像可用于组织内创建的 codespace。 + +如果开发容器配置中指定的映像与其中一个允许的映像不匹配,则当有人尝试为存储库创建 codespace 时,会显示以下消息: + +> 无法创建 codespace:根据组织管理员设置的组织策略,不允许使用基础映像“来自开发容器配置的详细信息”。 + +{% note %} + +**注释**: +* 基础映像策略仅在创建 codespace 时适用。 目前,在重新生成容器时不适用。 将来的版本中可能会发生变化。 有关详细信息,请参阅“[codespace 生命周期](/codespaces/developing-in-codespaces/the-codespace-lifecycle#rebuilding-a-codespace)”。 +* 基本映像策略不适用于默认映像,也不适用于在开发容器配置中引入错误导致无法重新生成容器的情况下用于恢复 codespace 的映像。 + +{% endnote %} + +### 设置组织范围和存储库特定的策略 + +创建策略时,您可以选择是将其应用于组织中的所有存储库,还是仅应用于指定的存储库。 如果设置了组织范围的策略,则为各个存储库设置的任何策略都必须在组织级别设置的限制范围内。 添加策略会增加映像的限制,而不是减少。 + +例如,你可以创建一个组织范围的策略,将基础映像限制为十个指定映像中的任意一个。 然后,可以为存储库 A 设置一个策略,将映像限制为仅在组织级别指定的两个映像的子集上。 为存储库 A 指定其他映像将不起作用,因为这些映像未在组织级别策略中指定。 如果添加组织范围的策略,则应将其设置为组织中任何存储库可用的最大映像选择范围。 然后,您可以添加特定于存储库的策略以进一步限制选择。 + +{% data reusables.codespaces.codespaces-org-policies-note %} + +## 添加策略以定义允许的映像 + +{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} {% data reusables.codespaces.codespaces-org-policies %} +1. 单击“添加约束”并选择“基础映像” 。 + + ![“添加约束”下拉菜单的屏幕截图](/assets/images/help/codespaces/add-constraint-dropdown-image.png) + +1. 单击 {% octicon "pencil" aria-label="The edit icon" %} 编辑约束。 + + ![用于编辑约束的铅笔图标的屏幕截图](/assets/images/help/codespaces/edit-image-constraint.png) + +1. 在“允许的值”字段中,输入想要允许的映像的完整 URL。 + + ![“允许的值”字段中条目的屏幕截图](/assets/images/help/codespaces/image-allowed-values.png) + + {% note %} + + 注意:必须指定与开发容器配置中指定的值完全匹配的映像 URL。 + + {% endnote %} + +1. 单击加号按钮 ({% octicon "plus" aria-label="The plus icon" %}) 添加值。 +1. 如果需要,请重复前两个步骤以添加更多映像 URL。 +{% data reusables.codespaces.codespaces-policy-targets %} +1. 如果要向策略添加另一个约束,请单击“添加约束”并选择另一个约束。 有关其他约束的信息,请参阅: + * “[限制对计算机类型的访问](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)” + * [限制转发端口的可见性](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports) + * [限制空闲超时期限](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period) + * [限制 codespace 的保持期](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces) +1. 向策略添加完约束后,单击“保存”。 + +当有人尝试创建可向组织收费的新 codespace 时,将应用该策略。 基本映像约束不会影响现有 codespace(无论是活动的还是停止的)。 + +## 编辑策略 + +可以编辑现有策略。 例如,你可能想要在策略中添加或移除约束。 + +1. 显示“Codespace policies(代码空间策略)”页。 有关详细信息,请参阅“[添加策略以定义允许的映像](#adding-a-policy-to-define-the-allowed-images)”。 +1. 单击要编辑的策略的名称。 +1. 单击“基础映像”约束旁边的铅笔图标 ({% octicon "pencil" aria-label="The edit icon" %})。 +1. 添加或移除映像 URL。 +1. 单击“保存”。 + +## 删除策略 + +1. 显示“Codespace policies(代码空间策略)”页。 有关详细信息,请参阅“[添加策略以定义允许的映像](#adding-a-policy-to-define-the-allowed-images)”。 +1. 单击要删除的策略右侧的删除按钮。 + + ![策略的“删除”按钮的屏幕截图](/assets/images/help/codespaces/policy-delete.png) diff --git a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period.md b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period.md index 28aec3606f..a610e78782 100644 --- a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period.md +++ b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period.md @@ -1,7 +1,7 @@ --- -title: Restricting the idle timeout period +title: 限制空闲超时期限 shortTitle: Restrict timeout periods -intro: You can set a maximum timeout period for any codespaces owned by your organization. +intro: 你可以为组织拥有的任何 codespace 设置最大超时时间。 permissions: 'To manage timeout constraints for an organization''s codespaces, you must be an owner of the organization.' versions: fpt: '*' @@ -9,77 +9,80 @@ versions: type: how_to topics: - Codespaces +ms.openlocfilehash: b07d1834078b065eee89acdb84e0e80a2db1e8a6 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158987' --- +## 概述 -## Overview +默认情况下,codespace 会在处于非活动状态 30 分钟后超时。 当 codespace 超时时,它会停止,并且不会再产生计算使用费用。 -By default, codespaces time out after 30 minutes of inactivity. When a codespace times out it is stopped and will no longer incur charges for compute usage. +{% data variables.product.prodname_dotcom %} 用户的个人设置允许他们为创建的 codespace 定义自己的超时期限。 这可能比默认的 30 分钟期限长。 有关详细信息,请参阅“[设置 {% data variables.product.prodname_github_codespaces %} 的超时时间](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-github-codespaces)”。 -The personal settings of a {% data variables.product.prodname_dotcom %} user allow them to define their own timeout period for codespaces they create. This may be longer than the default 30-minute period. For more information, see "[Setting your timeout period for {% data variables.product.prodname_github_codespaces %}](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-github-codespaces)." - -As an organization owner, you may want to configure constraints on the maximum idle timeout period for codespaces created for repositories owned by your organization. This can help you to limit costs associated with codespaces that are left to timeout after long periods of inactivity. You can set a maximum timeout for the codespaces for all repositories owned by your organization, or for the codespaces of specific repositories. +作为组织所有者,你可能希望为针对组织拥有的存储库创建的 codespace 的最大空闲超时时间配置约束。 这有助于限制与长时间处于非活动状态后超时的 codespace 相关的成本。 你可以为组织拥有的所有存储库的 codespace 或特定存储库的 codespace 设置最大超时。 {% note %} -**Note**: Maximum idle timeout constraints only apply to codespaces that are owned by your organization. +注意:最大空闲超时约束仅应用于组织拥有的 codespace。 {% endnote %} -For more information about pricing for {% data variables.product.prodname_github_codespaces %} compute usage, see "[About billing for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#codespaces-pricing)." +有关 {% data variables.product.prodname_github_codespaces %} 计算使用量的定价的详细信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#codespaces-pricing)”。 -### Behavior when you set a maximum idle timeout constraint +### 设置最大空闲超时约束时的行为 -If someone sets the default idle timeout to 90 minutes in their personal settings and they then start a codespace for a repository with a maximum idle timeout constraint of 60 minutes, the codespace will time out after 60 minutes of inactivity. When codespace creation completes, a message explaining this will be displayed: +如果某人在其个人设置中将默认空闲超时设置为 90 分钟,然后为具有最大空闲超时约束的存储库启动 codespace 60 分钟,则该 codespace 将在处于非活动状态 60 分钟后超时。 codespace 创建完成后,将显示一条消息,指出这一点: -> Idle timeout for this codespace is set to 60 minutes in compliance with your organization’s policy. +> 根据组织的策略,此 codespace 的空闲超时设置为 60 分钟。 -### Setting organization-wide and repository-specific policies +### 设置组织范围和存储库特定的策略 -When you create a policy, you choose whether it applies to all repositories in your organization, or only to specified repositories. If you create an organization-wide policy with a timeout constraint, then the timeout constraints in any policies that are targeted at specific repositories must fall within the restriction configured for the entire organization. The shortest timeout period - in an organization-wide policy, a policy targeted at specified repositories, or in someone's personal settings - is applied. +创建策略时,你可以选择是将其应用于组织中的所有存储库,还是仅应用于指定的存储库。 如果创建具有超时约束的组织范围的策略,则针对特定存储库的任何策略中的超时约束必须属于为整个组织配置的限制。 在组织范围的策略、针对指定存储库的策略或某人的个人设置中的策略中,将应用最短的超时期限。 -If you add an organization-wide policy with a timeout constraint, you should set the timeout to the longest acceptable period. You can then add separate policies that set the maximum timeout to a shorter period for specific repositories in your organization. +如果添加具有超时约束的组织范围的策略,则应将超时设置为最长可接受的期限。 然后,可以添加单独的策略,将组织内特定存储库的最大超时设置为较短的期限。 {% data reusables.codespaces.codespaces-org-policies-note %} -## Adding a policy to set a maximum idle timeout period +## 添加策略以设置最大空闲超时期限 -{% data reusables.profile.access_org %} -{% data reusables.profile.org_settings %} -{% data reusables.codespaces.codespaces-org-policies %} -1. Click **Add constraint** and choose **Maximum idle timeout**. +{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} {% data reusables.codespaces.codespaces-org-policies %} +1. 单击“添加约束”,然后选择“最大空闲超时”。 - ![Screenshot of the 'Add constraint' dropdown menu](/assets/images/help/codespaces/add-constraint-dropdown-timeout.png) + ![“添加约束”下拉菜单的屏幕截图](/assets/images/help/codespaces/add-constraint-dropdown-timeout.png) -1. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the constraint. +1. 单击 {% octicon "pencil" aria-label="The edit icon" %} 编辑约束。 - ![Screenshot of the pencil icon for editing the constraint](/assets/images/help/codespaces/edit-timeout-constraint.png) + ![用于编辑约束的铅笔图标的屏幕截图](/assets/images/help/codespaces/edit-timeout-constraint.png) -1. Enter the maximum number of minutes codespaces can remain inactive before they time out, then click **Save**. +1. 输入 codespace 的最大分钟数可以在超时之前保持非活动状态,然后单击“保存”。 - ![Screenshot of setting the maximum timeout in minutes](/assets/images/help/codespaces/maximum-minutes-timeout.png) + ![设置最大超时(以分钟为单位)的屏幕截图](/assets/images/help/codespaces/maximum-minutes-timeout.png) {% data reusables.codespaces.codespaces-policy-targets %} -1. If you want to add another constraint to the policy, click **Add constraint** and choose another constraint. For information about other constraints, see: - * "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)" - * "[Restricting the base image for codespaces](/codespaces/managing-codespaces-for-your-organization/restricting-the-base-image-for-codespaces)" - * "[Restricting the visibility of forwarded ports](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)" - * "[Restricting the retention period for codespaces](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces)" -1. After you've finished adding constraints to your policy, click **Save**. +1. 如果要向策略添加另一个约束,请单击“添加约束”并选择另一个约束。 有关其他约束的信息,请参阅: + * “[限制对计算机类型的访问](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)” + * [限制 codespace 的基础映像](/codespaces/managing-codespaces-for-your-organization/restricting-the-base-image-for-codespaces) + * [限制转发端口的可见性](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports) + * [限制 codespace 的保持期](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces) +1. 向策略添加完约束后,单击“保存”。 -The policy will be applied to all new codespaces that are billable to your organization. The timeout constraint is also applied to existing codespaces the next time they are started. +策略将应用于对组织计费的所有新 codespace。 下次启动现有 codespace 时,超时约束也会对其应用。 -## Editing a policy +## 编辑策略 -You can edit an existing policy. For example, you may want to add or remove constraints to or from a policy. +可以编辑现有策略。 例如,你可能想要在策略中添加或移除约束。 -1. Display the "Codespace policies" page. For more information, see "[Adding a policy to set a maximum idle timeout period](#adding-a-policy-to-set-a-maximum-idle-timeout-period)." -1. Click the name of the policy you want to edit. -1. Click the pencil icon ({% octicon "pencil" aria-label="The edit icon" %}) beside the "Maximum idle timeout" constraint. -1. Make the required changes then click **Save**. +1. 显示“Codespace policies(代码空间策略)”页。 有关详细信息,请参阅“[添加策略以设置最大空闲超时期限](#adding-a-policy-to-set-a-maximum-idle-timeout-period)”。 +1. 单击要编辑的策略的名称。 +1. 单击“最大空闲超时”约束旁边的铅笔图标 ({% octicon "pencil" aria-label="The edit icon" %})。 +1. 执行所需更改,然后单击“保存”。 -## Deleting a policy +## 删除策略 -1. Display the "Codespace policies" page. For more information, see "[Adding a policy to set a maximum idle timeout period](#adding-a-policy-to-set-a-maximum-idle-timeout-period)." -1. Click the delete button to the right of the policy you want to delete. +1. 显示“Codespace policies(代码空间策略)”页。 有关详细信息,请参阅“[添加策略以设置最大空闲超时期限](#adding-a-policy-to-set-a-maximum-idle-timeout-period)”。 +1. 单击要删除的策略右侧的删除按钮。 - ![Screenshot of the delete button for a policy](/assets/images/help/codespaces/policy-delete.png) + ![策略的“删除”按钮的屏幕截图](/assets/images/help/codespaces/policy-delete.png) diff --git a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces.md b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces.md index 37668e6931..f28c8b6b31 100644 --- a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces.md +++ b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces.md @@ -1,7 +1,7 @@ --- -title: Restricting the retention period for codespaces +title: 限制 codespace 的保持期 shortTitle: Restrict the retention period -intro: You can set a maximum retention period for any codespaces owned by your organization. +intro: 可以为组织拥有的任何 codespace 设置最大保持期。 permissions: 'To manage retention constraints for an organization''s codespaces, you must be an owner of the organization.' versions: fpt: '*' @@ -9,76 +9,79 @@ versions: type: how_to topics: - Codespaces +ms.openlocfilehash: 3c114fe41b06176899f9dd11a6dcd51c038c88e5 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158979' --- +## 概述 -## Overview +{% data variables.product.prodname_github_codespaces %} 在停止后自动删除,并在定义的天数内保持非活动状态。 创建 codespace 时,将设置每个 codespace 的保持期且不会更改。 -{% data variables.product.prodname_github_codespaces %} are automatically deleted after they have been stopped and have remained inactive for a defined number of days. The retention period for each codespace is set when the codespace is created and does not change. +有权访问 {% data variables.product.prodname_github_codespaces %} 的每个人都可以为其创建的 codespace 配置保持期。 此默认保持期的初始设置为 30 天。 个人用户可以在 0-30 天内设置此期限。 有关详细信息,请参阅“[配置 codespace 的自动删除](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces)”。 -Everyone who has access to {% data variables.product.prodname_github_codespaces %} can configure a retention period for the codespaces they create. The initial setting for this default retention period is 30 days. Individual users can set this period within the range 0-30 days. For more information, see "[Configuring automatic deletion of your codespaces](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces)." +作为组织所有者,你可能希望为针对组织拥有的存储库创建的 codespace 的最大保持期配置约束。 这有助于限制与停止的 codespace 相关联的存储成本,然后在它们自动删除之前保持未使用状态。 有关存储费用的详细信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#codespaces-pricing)”。 可以为组织拥有的所有或特定存储库设置最大保持期。 -As an organization owner, you may want to configure constraints on the maximum retention period for codespaces created for the repositories owned by your organization. This can help you to limit the storage costs associated with codespaces that are stopped and then left unused until they are automatically deleted. For more information about storage charges, see "[About billing for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#codespaces-pricing)." You can set a maximum retention period for all, or for specific, repositories owned by your organization. +### 设置组织范围和存储库特定的策略 -### Setting organization-wide and repository-specific policies +创建策略时,你可以选择是将其应用于组织中的所有存储库,还是仅应用于指定的存储库。 如果使用 codespace 保留约束创建组织范围的策略,则针对特定存储库的任何策略中的保留约束应小于为整个组织配置的限制,否则它们将不起作用。 在组织范围的策略、针对指定存储库的策略或某人个人设置中默认保持期中,将应用最短保持期。 -When you create a policy, you choose whether it applies to all repositories in your organization, or only to specified repositories. If you create an organization-wide policy with a codespace retention constraint, then the retention constraints in any policies that are targeted at specific repositories should be shorter than the restriction configured for the entire organization, or they will have no effect. The shortest retention period - in an organization-wide policy, a policy targeted at specified repositories, or the default retention period in someone's personal settings - is applied. - -If you add an organization-wide policy with a retention constraint, you should set the retention period to the longest acceptable period. You can then add separate policies that set the maximum retention to a shorter period for specific repositories in your organization. +如果添加具有保留约束的组织范围的策略,则应将保持期设置为最长可接受的期限。 然后,可以添加单独的策略,将组织内特定存储库的最大保持期设置为较短的期限。 {% data reusables.codespaces.codespaces-org-policies-note %} -## Adding a policy to set a maximum codespace retention period +## 添加策略来设置最大 codespace 保持期 -{% data reusables.profile.access_org %} -{% data reusables.profile.org_settings %} -{% data reusables.codespaces.codespaces-org-policies %} -1. Click **Add constraint** and choose **Retention period**. +{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} {% data reusables.codespaces.codespaces-org-policies %} +1. 单击“添加约束”并选择“保持期”。 - ![Screenshot of the 'Add constraint' dropdown menu](/assets/images/help/codespaces/add-constraint-dropdown-retention.png) + ![“添加约束”下拉菜单的屏幕截图](/assets/images/help/codespaces/add-constraint-dropdown-retention.png) -1. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the constraint. +1. 单击 {% octicon "pencil" aria-label="The edit icon" %} 编辑约束。 - ![Screenshot of the pencil icon for editing the constraint](/assets/images/help/codespaces/edit-timeout-constraint.png) + ![用于编辑约束的铅笔图标的屏幕截图](/assets/images/help/codespaces/edit-timeout-constraint.png) -1. Enter the maximum number of days codespaces can remain stopped before they are automatically deleted, then click **Save**. +1. 输入在自动删除 codespace 之前可以保持停止的最大天数,然后单击“保存”。 - ![Screenshot of setting the retention period in days](/assets/images/help/codespaces/maximum-days-retention.png) + ![设置屏幕截图(以天为单位)的屏幕截图](/assets/images/help/codespaces/maximum-days-retention.png) {% note %} - **Notes**: - * A day, in this context, is a 24-hour period, beginning at the time of day when the codespace was stopped. - * The valid range is 0-30 days. - * Setting the period to `0` will result in codespaces being immediately deleted when they are stopped, or when they timeout due to inactivity. + **注释**: + * 在此上下文中,一天指的是 24 小时时段,从 codespace 当天停止的时间开始。 + * 有效范围是 0 到 30 天。 + * 将期限设置为 `0` 将导致 codespace 在停止时或由于不活动而超时时被立即删除。 {% endnote %} {% data reusables.codespaces.codespaces-policy-targets %} -1. If you want to add another constraint to the policy, click **Add constraint** and choose another constraint. For information about other constraints, see: - * "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)" - * "[Restricting the base image for codespaces](/codespaces/managing-codespaces-for-your-organization/restricting-the-base-image-for-codespaces)" - * "[Restricting the visibility of forwarded ports](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)" - * "[Restricting the idle timeout period](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)" -1. After you've finished adding constraints to your policy, click **Save**. +1. 如果要向策略添加另一个约束,请单击“添加约束”并选择另一个约束。 有关其他约束的信息,请参阅: + * “[限制对计算机类型的访问](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)” + * [限制 codespace 的基础映像](/codespaces/managing-codespaces-for-your-organization/restricting-the-base-image-for-codespaces) + * [限制转发端口的可见性](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports) + * [限制空闲超时期限](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period) +1. 向策略添加完约束后,单击“保存”。 -The policy will be applied to all new codespaces that are billable to your organization. The retention period constraint is only applied on codespace creation. +策略将应用于对组织计费的所有新 codespace。 保持期约束仅在创建 codespace 时应用。 -## Editing a policy +## 编辑策略 -You can edit an existing policy. For example, you may want to add or remove constraints to or from a policy. +可以编辑现有策略。 例如,你可能想要在策略中添加或移除约束。 -The retention period constraint is only applied to codespaces when they are created. Editing a policy has no effect on existing codespaces. +保持期约束仅在创建 codespace 时应用于它们。 编辑策略不会影响现有 codespace。 -1. Display the "Codespace policies" page. For more information, see "[Adding a policy to set a maximum codespace retention period](#adding-a-policy-to-set-a-maximum-codespace-retention-period)." -1. Click the name of the policy you want to edit. -1. Click the pencil icon ({% octicon "pencil" aria-label="The edit icon" %}) beside the "Retention period" constraint. -1. Make the required changes then click **Save**. +1. 显示“Codespace policies(代码空间策略)”页。 有关详细信息,请参阅“[添加策略以设置最大 codespace 保持期](#adding-a-policy-to-set-a-maximum-codespace-retention-period)”。 +1. 单击要编辑的策略的名称。 +1. 单击“保持期”约束旁边的铅笔图标 ({% octicon "pencil" aria-label="The edit icon" %})。 +1. 执行所需更改,然后单击“保存”。 -## Deleting a policy +## 删除策略 -You can delete a policy at any time. Deleting a policy has no effect on existing codespaces. +可以随时删除策略。 删除策略不会影响现有 codespace。 -1. Display the "Codespace policies" page. For more information, see "[Adding a policy to set a maximum codespace retention period](#adding-a-policy-to-set-a-maximum-codespace-retention-period)." -1. Click the delete button to the right of the policy you want to delete. +1. 显示“Codespace policies(代码空间策略)”页。 有关详细信息,请参阅“[添加策略以设置最大 codespace 保持期](#adding-a-policy-to-set-a-maximum-codespace-retention-period)”。 +1. 单击要删除的策略右侧的删除按钮。 - ![Screenshot of the delete button for a policy](/assets/images/help/codespaces/policy-delete.png) + ![策略的“删除”按钮的屏幕截图](/assets/images/help/codespaces/policy-delete.png) diff --git a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports.md b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports.md index a6e15aa254..9b654ca5a2 100644 --- a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports.md +++ b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports.md @@ -1,7 +1,7 @@ --- -title: Restricting the visibility of forwarded ports +title: 限制转发端口的可见性 shortTitle: Restrict port visibility -intro: You can set constraints on the visibility options users can choose when they forward ports from codespaces in your organization. +intro: 你可以针对用户从组织中的 codespace 转发端口时选择的可见性选项设置约束。 permissions: 'To manage access to port visibility constraints for the repositories in an organization, you must be an owner of the organization.' versions: fpt: '*' @@ -9,73 +9,76 @@ versions: type: how_to topics: - Codespaces +ms.openlocfilehash: ad670b43e0ac2a80e43048ffa61e0c83a8d12130 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158971' --- +## 概述 -## Overview +通常,在 codespace 中,可以私密地(仅向你自己)、向组织成员或公开(向任何具有 URL 的人)转发端口。 有关详细信息,请参阅“[在 codespace 中转发端口](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)”。 -Typically, within a codespace you are able to forward ports privately (only to yourself), to members of your organization, or publicly (to anyone with the URL). For more information, see "[Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)." +作为组织所有者,你可能希望对用户在转发端口时可以设置的可见性选项配置约束。 例如,出于安全原因,你可能希望禁止公共端口转发。 为此,你可以在组织的 {% data variables.product.prodname_github_codespaces %} 设置中定义一个或多个策略。 -As an organization owner, you may want to configure constraints on the visibility options users can set when forwarding ports. For example, for security reasons, you may want to disallow public port forwarding. You do this by defining one or more policies in the {% data variables.product.prodname_github_codespaces %} settings for your organization. +### 设置端口可见性约束时的行为 -### Behavior when you set a port visibility constraint - -If there are existing codespaces that no longer conform to a policy you have defined, these codespaces will continue to operate until they are stopped or time out. When the user resumes the codespace, it will be subject to the policy constraints. +如果存在不再符合你定义的策略的现有 codespaces,这些 codespaces 将继续运行,直到它们停止或超时。当用户继续使用 codespace 时,将受策略约束。 {% note %} -**Note**: You can't disable private port forwarding, as private port forwarding is required by {% data variables.product.prodname_github_codespaces %} to continue working as designed, for example to forward SSH on port 22. +注意:无法禁用专用端口转发,因为 {% data variables.product.prodname_github_codespaces %} 需要专用端口转发才能继续按照设计的方式工作,例如在端口 22 上转发 SSH。 {% endnote %} -### Setting organization-wide and repository-specific policies +### 设置组织范围和存储库特定的策略 -When you create a policy you choose whether it applies to all repositories in your organization, or only to specified repositories. If you set an organization-wide policy then any policies you set for individual repositories must fall within the restriction set at the organization level. Adding policies makes the choice of visibility options more, not less, restrictive. +创建策略时,您可以选择是将其应用于组织中的所有存储库,还是仅应用于指定的存储库。 如果设置了组织范围的策略,则为各个存储库设置的任何策略都必须在组织级别设置的限制范围内。 添加策略会增加可见性选项的限制,而不是减少。 -For example, you could create an organization-wide policy that restricts the visibility options to organization only. You can then set a policy for Repository A that disallows both public and organization visibility, which would result in only private port forwarding being available for this repository. Setting a policy for Repository A that allowed both public and organization would result in only organization visibility, because the organization-wide policy does not allow public visibility. +例如,你可以创建一个组织范围的策略,将可见性选项限制在组织范围内。 然后,可以为存储库 A 设置一个策略,该策略不允许公共和组织可见性,这将导致此存储库只能使用专用端口转发。 如果为存储库 A 设置一个既允许公开又允许组织的策略,将只有组织可见,因为组织范围的策略不允许公开可见性。 -If you add an organization-wide policy, you should set it to the most lenient visibility option that will be available for any repository in your organization. You can then add repository-specific policies to further restrict the choice. +如果添加组织范围的策略,则应将其设置为组织中任何存储库可用的最宽松的可见性选项。 然后,您可以添加特定于存储库的策略以进一步限制选择。 {% data reusables.codespaces.codespaces-org-policies-note %} -## Adding a policy to limit the port visibility options +## 添加限制端口可见性选项的策略 -{% data reusables.profile.access_org %} -{% data reusables.profile.org_settings %} -{% data reusables.codespaces.codespaces-org-policies %} -1. Click **Add constraint** and choose **Port visibility**. +{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} {% data reusables.codespaces.codespaces-org-policies %} +1. 单击“添加约束”并选择“端口可见性” 。 - ![Screenshot of the 'Add constraint' dropdown menu](/assets/images/help/codespaces/add-constraint-dropdown-ports.png) + ![“添加约束”下拉菜单的屏幕截图](/assets/images/help/codespaces/add-constraint-dropdown-ports.png) -1. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the constraint. +1. 单击 {% octicon "pencil" aria-label="The edit icon" %} 编辑约束。 - ![Screenshot of the pencil icon for editing the constraint](/assets/images/help/codespaces/edit-port-visibility-constraint.png) + ![用于编辑约束的铅笔图标的屏幕截图](/assets/images/help/codespaces/edit-port-visibility-constraint.png) -1. Clear the selection of the port visibility options (**Org** or **Public**) that you don't want to be available. +1. 清除不希望提供的端口可见性选项(组织或公共) 。 - ![Screenshot of clearing a port visibility option](/assets/images/help/codespaces/choose-port-visibility-options.png) + ![清除端口可见性选项的屏幕截图](/assets/images/help/codespaces/choose-port-visibility-options.png) {% data reusables.codespaces.codespaces-policy-targets %} -1. If you want to add another constraint to the policy, click **Add constraint** and choose another constraint. For information about other constraints, see: - * "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)" - * "[Restricting the base image for codespaces](/codespaces/managing-codespaces-for-your-organization/restricting-the-base-image-for-codespaces)" - * "[Restricting the idle timeout period](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)" - * "[Restricting the retention period for codespaces](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces)" -1. After you've finished adding constraints to your policy, click **Save**. +1. 如果要向策略添加另一个约束,请单击“添加约束”并选择另一个约束。 有关其他约束的信息,请参阅: + * “[限制对计算机类型的访问](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)” + * [限制 codespace 的基础映像](/codespaces/managing-codespaces-for-your-organization/restricting-the-base-image-for-codespaces) + * [限制空闲超时期限](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period) + * [限制 codespace 的保持期](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces) +1. 向策略添加完约束后,单击“保存”。 -The policy will be applied to all new codespaces that are billable to your organization. The port visibility constraint is also applied to existing codespaces the next time they are started. +策略将应用于对组织计费的所有新 codespace。 下次启动现有 codespace 时,端口可见性约束也会对其应用。 -## Editing a policy +## 编辑策略 -You can edit an existing policy. For example, you may want to add or remove constraints to or from a policy. +可以编辑现有策略。 例如,你可能想要在策略中添加或移除约束。 -1. Display the "Codespace policies" page. For more information, see "[Adding a policy to limit the port visibility options](#adding-a-policy-to-limit-the-port-visibility-options)." -1. Click the name of the policy you want to edit. -1. Click the pencil icon ({% octicon "pencil" aria-label="The edit icon" %}) beside the "Port visibility" constraint. -1. Make the required changes then click **Save**. +1. 显示“Codespace policies(代码空间策略)”页。 有关详细信息,请参阅“[添加策略以限制端口可见性选项](#adding-a-policy-to-limit-the-port-visibility-options)”。 +1. 单击要编辑的策略的名称。 +1. 单击“端口可见性”约束旁边的铅笔图标 ({% octicon "pencil" aria-label="The edit icon" %})。 +1. 执行所需更改,然后单击“保存”。 -## Deleting a policy +## 删除策略 -1. Display the "Codespace policies" page. For more information, see "[Adding a policy to limit the port visibility options](#adding-a-policy-to-limit-the-port-visibility-options)." -1. Click the delete button to the right of the policy you want to delete. +1. 显示“Codespace policies(代码空间策略)”页。 有关详细信息,请参阅“[添加策略以限制端口可见性选项](#adding-a-policy-to-limit-the-port-visibility-options)”。 +1. 单击要删除的策略右侧的删除按钮。 - ![Screenshot of the delete button for a policy](/assets/images/help/codespaces/policy-delete.png) + ![策略的“删除”按钮的屏幕截图](/assets/images/help/codespaces/policy-delete.png) diff --git a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-github-codespaces.md b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-github-codespaces.md index 4dc53ccac7..5fc9d71fc6 100644 --- a/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-github-codespaces.md +++ b/translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-github-codespaces.md @@ -1,7 +1,7 @@ --- -title: Reviewing your organization's audit logs for GitHub Codespaces +title: 查看组织的 GitHub Codespaces 审核日志 shortTitle: Audit logs -intro: 'You can use the audit log to review all actions related to {% data variables.product.prodname_github_codespaces %}.' +intro: '你可以使用审核日志查看与 {% data variables.product.prodname_github_codespaces %} 相关的所有操作。' versions: fpt: '*' ghec: '*' @@ -12,17 +12,20 @@ topics: - Administrator redirect_from: - /codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-codespaces +ms.openlocfilehash: 81fbf92217c704ece2f1076de03e1f0445ded2c5 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159503' --- +当组织的任何成员执行与 {% data variables.product.prodname_github_codespaces %} 相关的操作时,你可以在审核日志中查看这些操作。 有关访问日志的信息,请参阅“[查看审核日志](/organizations/keeping-your-organization-secure/reviewing-the-audit-log-for-your-organization#accessing-the-audit-log)”。 - +![包含代码空间信息的审核日志](/assets/images/help/settings/codespaces-audit-log-org.png) -When any member of your organization performs an action related to {% data variables.product.prodname_github_codespaces %}, you can review the actions in the audit log. For information about accessing the log, see "[Reviewing your audit log](/organizations/keeping-your-organization-secure/reviewing-the-audit-log-for-your-organization#accessing-the-audit-log)." +审核日志包含操作执行人、操作内容和执行时间等详细信息。 有关 {% data variables.product.prodname_github_codespaces %} 操作的信息,请参阅“[`codespaces` 类别操作](/organizations/keeping-your-organization-secure/reviewing-the-audit-log-for-your-organization#codespaces-category-actions)”。 -![Audit log with Codespaces information](/assets/images/help/settings/codespaces-audit-log-org.png) +## 延伸阅读 -The audit log includes details such as who performed the action, what the action was, and when the action was performed. For information on {% data variables.product.prodname_github_codespaces %} actions, see "[`codespaces` category actions](/organizations/keeping-your-organization-secure/reviewing-the-audit-log-for-your-organization#codespaces-category-actions)." - -## Further reading - -- "[Reviewing your security logs for {% data variables.product.prodname_github_codespaces %}](/codespaces/managing-your-codespaces/reviewing-your-security-logs-for-github-codespaces)" -- "[{% data variables.product.prodname_github_codespaces %} logs](/codespaces/troubleshooting/github-codespaces-logs)" +- “[查看 {% data variables.product.prodname_github_codespaces %} 的安全日志](/codespaces/managing-your-codespaces/reviewing-your-security-logs-for-github-codespaces)” +- [{% data variables.product.prodname_github_codespaces %} 日志](/codespaces/troubleshooting/github-codespaces-logs) diff --git a/translations/zh-CN/content/codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces.md b/translations/zh-CN/content/codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces.md index 6a2cc72fd6..c6b0b4905b 100644 --- a/translations/zh-CN/content/codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces.md +++ b/translations/zh-CN/content/codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces.md @@ -1,6 +1,6 @@ --- -title: Managing encrypted secrets for your codespaces -intro: 'You can store sensitive information, like tokens, that you want to access in your codespaces via environment variables.' +title: 管理代码空间的加密密码 +intro: 您可以在代码空间中存储要通过环境变量访问的敏感信息(如令牌)。 versions: fpt: '*' ghec: '*' @@ -14,89 +14,84 @@ topics: - Security - Secret store shortTitle: Encrypted secrets +ms.openlocfilehash: f2ef60c9311a81ea59ec4f71cb7c1a432102b063 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148160440' --- +## 关于 {% data variables.product.prodname_github_codespaces %} 的加密机密 - +你可以将要在 codespace 中使用的加密密码添加到你的个人帐户。 例如,您可能想要存储和访问以下敏感信息作为加密密码。 +- 云服务的访问令牌 +- 服务主体 +- 订阅标识符 +- [专用映像注册表的凭据](/codespaces/codespaces-reference/allowing-your-codespace-to-access-a-private-image-registry) -## About encrypted secrets for {% data variables.product.prodname_github_codespaces %} - -You can add encrypted secrets to your personal account that you want to use in your codespaces. For example, you may want to store and access the following sensitive information as encrypted secrets. - -- Access tokens to cloud services -- Service principals -- Subscription identifiers -- [Credentials for a private image registry](/codespaces/codespaces-reference/allowing-your-codespace-to-access-a-private-image-registry) - -You can choose which repositories should have access to each secret. Then, you can use the secret in any codespace you create for a repository that has access to the secret. To share a secret with a codespace created from a template, you will need to publish the codespace to a repository on {% data variables.product.prodname_dotcom %}, then give that repository access to the secret. +您可以选择哪些仓库应有权访问每个密码。 然后,您可以在为有权访问密码的仓库创建的任何代码空间中使用该密码。 若要与通过模板创建的 codespace 共享机密,需要将 codespace 发布到 {% data variables.product.prodname_dotcom %} 上的存储库,然后授予该存储库对该机密的访问权限。 {% data reusables.codespaces.secrets-on-start %} -### Naming secrets +### 命名密钥 -{% data reusables.codespaces.secrets-naming %} For example, a secret created at the repository level must have a unique name in that repository. +{% data reusables.codespaces.secrets-naming %} 例如,在仓库级别创建的密钥必须在该仓库中具有唯一的名称。 {% data reusables.codespaces.secret-precedence %} -### Limits for secrets +### 密码的限制 -You can store up to 100 secrets for {% data variables.product.prodname_github_codespaces %}. +最多可以为 {% data variables.product.prodname_github_codespaces %} 存储 100 个密码。 -Secrets are limited to 64 KB in size. +密码大小限于 64 KB。 -## Adding a secret +## 添加密码 -{% data reusables.user-settings.access_settings %} -{% data reusables.user-settings.codespaces-tab %} -1. To the right of "Codespaces secrets", click **New secret**. - !["New secret" button](/assets/images/help/settings/codespaces-new-secret-button.png) -1. Under "Name", type a name for your secret. - !["Name" text box](/assets/images/help/settings/codespaces-secret-name-field.png) -{% data reusables.user-settings.codespaces-secret-value %} -{% data reusables.user-settings.codespaces-secret-repository-access %} -1. Click **Add secret**. +{% data reusables.user-settings.access_settings %} {% data reusables.user-settings.codespaces-tab %} +1. 在“Codespaces 机密”右侧,单击“新建机密”。 + ![“新建机密”按钮](/assets/images/help/settings/codespaces-new-secret-button.png) +1. 在“Name(名称)”下,输入密码的名称。 + ![“名称”文本框](/assets/images/help/settings/codespaces-secret-name-field.png) {% data reusables.user-settings.codespaces-secret-value %} {% data reusables.user-settings.codespaces-secret-repository-access %} +1. 单击“添加机密”。 -## Editing a secret +## 编辑密码 -You can update the value of an existing secret, and you can change which repositories can access a secret. +您可以更新现有密码的值,也可以更改哪些仓库可以访问密码。 -{% data reusables.user-settings.access_settings %} -{% data reusables.user-settings.codespaces-tab %} -1. Under "Codespaces secrets", to the right of the secret you want to edit, click **Update**. - !["Update" button](/assets/images/help/settings/codespaces-secret-update-button.png) -1. Under "Value", click **enter a new value**. - !["enter a new value" link](/assets/images/help/settings/codespaces-secret-update-value-text.png) -{% data reusables.user-settings.codespaces-secret-value %} -{% data reusables.user-settings.codespaces-secret-repository-access %} -1. Optionally, to remove the secret's access to a repository, deselect the repository. - ![Checkboxes to remove access to repositories](/assets/images/help/settings/codespaces-secret-repository-checkboxes.png) -1. Click **Save changes**. +{% data reusables.user-settings.access_settings %} {% data reusables.user-settings.codespaces-tab %} +1. 在“Codespaces 机密”下,在要编辑的机密的右侧,单击“更新”。 + ![“更新”按钮](/assets/images/help/settings/codespaces-secret-update-button.png) +1. 在“值”下,单击“输入新值”。 + ![“输入新值”链接](/assets/images/help/settings/codespaces-secret-update-value-text.png) {% data reusables.user-settings.codespaces-secret-value %} {% data reusables.user-settings.codespaces-secret-repository-access %} +1. (可选)要删除密码对仓库的访问权限,请取消选择仓库。 + ![用于删除对存储库的访问权限的复选框](/assets/images/help/settings/codespaces-secret-repository-checkboxes.png) +1. 单击“保存更改”。 -## Deleting a secret +## 删除密码 -{% data reusables.user-settings.access_settings %} -{% data reusables.user-settings.codespaces-tab %} -1. Under "Codespaces secrets", to the right of the secret you want to delete, click **Delete**. - !["Delete" button](/assets/images/help/settings/codespaces-secret-delete-button.png) -1. Read the warning, then click **OK**. - ![Confirmation to delete secret](/assets/images/help/settings/codespaces-secret-delete-warning.png) +{% data reusables.user-settings.access_settings %} {% data reusables.user-settings.codespaces-tab %} +1. 在“Codespaces 机密”下,在要删除的机密的右侧,单击“删除”。 + ![“删除”按钮](/assets/images/help/settings/codespaces-secret-delete-button.png) +1. 阅读警告,然后单击“确定”。 + ![确认删除机密](/assets/images/help/settings/codespaces-secret-delete-warning.png) -## Using secrets +## 使用机密 -A secret is exported as an environment variable into the user's terminal session. +机密作为环境变量导出到用户的终端会话中。 - ![Displaying the value of an exported secret in the terminal](/assets/images/help/codespaces/exported-codespace-secret.png) + ![在终端显示导出机密的值](/assets/images/help/codespaces/exported-codespace-secret.png) -You can use secrets in a codespace after the codespace is built and is running. For example, a secret can be used: +Codespace 生成并运行后,可以在 Codespace 中使用机密。 例如,机密可用于: -* When launching an application from the integrated terminal or ssh session. -* Within a dev container lifecycle script that is run after the codespace is running. For more information about dev container lifecycle scripts, see the documentation on containers.dev: [Specification](https://containers.dev/implementors/json_reference/#lifecycle-scripts). +* 从集成终端或 ssh 会话启动应用程序时。 +* 在 Codespace 开始运行后运行的开发容器生命周期脚本中。 有关开发容器生命周期脚本的详细信息,请参阅 containers.dev 的相关文档:[规范](https://containers.dev/implementors/json_reference/#lifecycle-scripts)。 -Codespace secrets cannot be used: +codespace 机密不可用于以下情况: -* During codespace build time (that is, within a Dockerfile or custom entry point). -* Within a dev container feature. For more information, see the `features` property in the [dev containers specification](https://containers.dev/implementors/json_reference/#general-properties) on containers.dev. +* codespace 生成时(即,在 Dockerfile 或自定义入口点内)。 +* 在开发容器功能内。 有关详细信息,请参阅 containers.dev 上的[开发容器规范](https://containers.dev/implementors/json_reference/#general-properties)中的 `features` 属性。 -## Further reading +## 延伸阅读 -- "[Managing encrypted secrets for your repository and organization for {% data variables.product.prodname_github_codespaces %}](/codespaces/managing-codespaces-for-your-organization/managing-encrypted-secrets-for-your-repository-and-organization-for-github-codespaces)" +- “[管理 {% data variables.product.prodname_github_codespaces %} 的存储库和组织的加密密码](/codespaces/managing-codespaces-for-your-organization/managing-encrypted-secrets-for-your-repository-and-organization-for-github-codespaces)” diff --git a/translations/zh-CN/content/codespaces/managing-your-codespaces/managing-gpg-verification-for-github-codespaces.md b/translations/zh-CN/content/codespaces/managing-your-codespaces/managing-gpg-verification-for-github-codespaces.md index 692b4c28a6..181788f37f 100644 --- a/translations/zh-CN/content/codespaces/managing-your-codespaces/managing-gpg-verification-for-github-codespaces.md +++ b/translations/zh-CN/content/codespaces/managing-your-codespaces/managing-gpg-verification-for-github-codespaces.md @@ -1,6 +1,6 @@ --- -title: Managing GPG verification for GitHub Codespaces -intro: 'You can allow {% data variables.product.company_short %} to automatically use GPG to sign commits you make in your codespaces, so other people can be confident that the changes come from a trusted source.' +title: 管理 GitHub Codespaces 的 GPG 验证 +intro: '您可以允许 {% data variables.product.company_short %} 自动使用 GPG 对在代码空间中所做的提交进行签名,以便其他人可以确信更改来自受信任的源。' versions: fpt: '*' ghec: '*' @@ -14,26 +14,28 @@ redirect_from: - /codespaces/working-with-your-codespace/managing-gpg-verification-for-codespaces - /codespaces/managing-your-codespaces/managing-gpg-verification-for-codespaces shortTitle: GPG verification +ms.openlocfilehash: ff83eba1720a2841747536ec04bfc0b3db055669 +ms.sourcegitcommit: 47e03737d09bed84dfedb7be5924d893d34ea1a8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/16/2022 +ms.locfileid: '148167099' --- - - - -After you enable GPG verification, {% data variables.product.company_short %} will automatically sign commits you make in {% data variables.product.prodname_github_codespaces %}, and the commits will have a verified status on {% data variables.product.product_name %}. By default, GPG verification is disabled for codespaces you create. You can choose to allow GPG verification for all repositories or specific repositories. Only enable GPG verification for repositories that you trust. For more information about {% data variables.product.product_name %}-signed commits, see "[About commit signature verification](/github/authenticating-to-github/about-commit-signature-verification)." +启用 GPG 验证后,{% data variables.product.company_short %} 将自动对你在 {% data variables.product.prodname_github_codespaces %} 中所做的提交进行签名,并且该提交在 {% data variables.product.product_name %} 上具有已验证状态。 默认情况下,GPG 验证对您创建的代码空间禁用。 您可以选择对所有仓库或特定仓库允许 GPG 验证。 仅对您信任的仓库启用 GPG 验证。 有关 {% data variables.product.product_name %} 签名提交的更多信息,请参阅[关于提交签名验证](/github/authenticating-to-github/about-commit-signature-verification)。 {% data reusables.codespaces.gpg-in-active-codespaces %} {% note %} -**Note:** If you have linked a dotfiles repository with {% data variables.product.prodname_github_codespaces %}, the Git configuration in your dotfiles may conflict with the configuration that {% data variables.product.prodname_github_codespaces %} requires to sign commits. For more information, see "[Troubleshooting GPG verification for {% data variables.product.prodname_github_codespaces %}](/codespaces/troubleshooting/troubleshooting-gpg-verification-for-github-codespaces)." +注意:如果已将点文件存储库链接到 {% data variables.product.prodname_github_codespaces %},则点文件中的 Git 配置可能与 {% data variables.product.prodname_github_codespaces %} 签署提交所需的配置冲突。 有关详细信息,请参阅“[{% data variables.product.prodname_github_codespaces %} 的 GPG 验证疑难解答](/codespaces/troubleshooting/troubleshooting-gpg-verification-for-github-codespaces)”。 {% endnote %} -{% data reusables.user-settings.access_settings %} -{% data reusables.user-settings.codespaces-tab %} -1. Under "GPG verification", select the setting you want for GPG verification. - ![Radio buttons to manage GPG verification](/assets/images/help/settings/codespaces-gpg-verification-radio-buttons.png) -1. If you chose "Selected repositories", select the dropdown menu, then click a repository you want enable GPG verification for. Repeat for all repositories you want to enable GPG verification for. - !["Selected repositories" dropdown menu](/assets/images/help/settings/codespaces-gpg-verification-repository-drop-down.png) +{% data reusables.user-settings.access_settings %} {% data reusables.user-settings.codespaces-tab %} +1. 在“GPG verification(GPG 验证)”下,选择您想要的 GPG 验证设置。 + ![管理 GPG 验证的单选按钮](/assets/images/help/settings/codespaces-gpg-verification-radio-buttons.png) +1. 如果选择“所选存储库”,请选择下拉菜单,然后单击要为其启用 GPG 验证的存储库。 对您要启用 GPG 验证的所有仓库重复此操作。 + ![“所选存储库”下拉菜单](/assets/images/help/settings/codespaces-gpg-verification-repository-drop-down.png) -Once you have enabled GPG verification for {% data variables.product.prodname_github_codespaces %}, all commits are signed by default in your codespaces. \ No newline at end of file +为 {% data variables.product.prodname_github_codespaces %} 启用 GPG 验证后,默认情况下所有提交都会在 codespace 中进行签名。 diff --git a/translations/zh-CN/content/codespaces/managing-your-codespaces/managing-repository-access-for-your-codespaces.md b/translations/zh-CN/content/codespaces/managing-your-codespaces/managing-repository-access-for-your-codespaces.md index 4519c40fd5..a96ba3ef69 100644 --- a/translations/zh-CN/content/codespaces/managing-your-codespaces/managing-repository-access-for-your-codespaces.md +++ b/translations/zh-CN/content/codespaces/managing-your-codespaces/managing-repository-access-for-your-codespaces.md @@ -1,8 +1,8 @@ --- -title: Managing access to other repositories within your codespace +title: 管理对代码空间中其他存储库的访问权限 allowTitleToDifferFromFilename: true shortTitle: Repository access -intro: 'You can manage the repositories that {% data variables.product.prodname_github_codespaces %} can access.' +intro: '你可以管理 {% data variables.product.prodname_github_codespaces %} 可以访问的存储库。' versions: fpt: '*' ghec: '*' @@ -11,26 +11,31 @@ topics: - Security redirect_from: - /codespaces/managing-your-codespaces/managing-access-and-security-for-your-codespaces +ms.openlocfilehash: 3f8379c322bd7ccd9ff7d31e17da90a77461536d +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159487' --- +## 概述 -## Overview +默认情况下,代码空间分配有一个令牌,该令牌的范围限定为从中创建它的存储库。 将通过模板创建的 codespace 发布到 {% data variables.product.product_name %} 上的新存储库时,系统会为 codespace 分配一个作用域为新存储库的令牌。 有关详细信息,请参阅“[{% data variables.product.prodname_github_codespaces %} 中的安全性](/codespaces/codespaces-reference/security-in-github-codespaces#authentication)”。 如果项目需要其他存储库的其他权限,则可以在 `devcontainer.json` 文件中对此进行配置,并确保其他协作者具有正确的权限集。 -By default, your codespace is assigned a token scoped to the repository from which it was created. When you publish a codespace that you created from a template to a new repository on {% data variables.product.product_name %}, the codespace is assigned a token scoped to the new repository. For more information, see "[Security in {% data variables.product.prodname_github_codespaces %}](/codespaces/codespaces-reference/security-in-github-codespaces#authentication)." If your project needs additional permissions for other repositories, you can configure this in the `devcontainer.json` file and ensure other collaborators have the right set of permissions. +在 `devcontainer.json` 文件中列出权限时,系统会提示你在为该存储库创建代码空间时查看并授予其他权限。 授予列出的权限后,{% data variables.product.prodname_github_codespaces %} 将记住你的选择,除非 `devcontainer.json` 文件中的权限发生更改,否则不会提示你进行授予。 -When permissions are listed in the `devcontainer.json` file, you will be prompted to review and authorize the additional permissions as part of codespace creation for that repository. Once you've authorized the listed permissions, {% data variables.product.prodname_github_codespaces %} will remember your choice and will not prompt you for authorization unless the permissions in the `devcontainer.json` file change. +## 先决条件 -## Prerequisites +若要创建定义了自定义权限的代码空间,你必须使用以下项之一: +* {% data variables.product.prodname_dotcom %} Web UI +* [{% data variables.product.prodname_dotcom %} CLI](https://github.com/cli/cli/releases/latest) 2.5.2 或更高版本 +* [{% data variables.product.prodname_github_codespaces %} {% data variables.product.prodname_vscode %} 扩展](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces) 1.5.3 或更高版本 -To create codespaces with custom permissions defined, you must use one of the following: -* The {% data variables.product.prodname_dotcom %} web UI -* [{% data variables.product.prodname_dotcom %} CLI](https://github.com/cli/cli/releases/latest) 2.5.2 or later -* [{% data variables.product.prodname_github_codespaces %} {% data variables.product.prodname_vscode %} extension](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces) 1.5.3 or later +## 设置其他存储库权限 -## Setting additional repository permissions +1. 在 `devcontainer.json` 文件中配置 {% data variables.product.prodname_github_codespaces %} 的存储库权限。 如果存储库尚未包含 `devcontainer.json` 文件,请立即添加一个。 有关详细信息,请参阅“[将开发容器添加到项目](/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces)”。 -1. You configure repository permissions for {% data variables.product.prodname_github_codespaces %} in the `devcontainer.json` file. If your repository does not already contain a `devcontainer.json` file, add one now. For more information, "[Add a dev container to your project](/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces)." - -1. Edit the `devcontainer.json` file, adding the repository name and permissions needed to the `repositories` object: +1. 编辑 `devcontainer.json` 文件,添加 `repositories` 对象所需的存储库名称和权限: ```json{:copy} { @@ -50,25 +55,25 @@ To create codespaces with custom permissions defined, you must use one of the fo {% note %} - **Note:** You can only reference repositories that belong to the same personal account or organization as the repository you are currently working in. + 注意:只能将属于同一个人帐户或组织的存储库引用为当前正在使用的存储库。 {% endnote %} - You can grant as many or as few of the following permissions for each repository listed: - * `actions` - read / write - * `checks` - read / write - * `contents` - read / write - * `deployments` - read / write - * `discussions` - read / write - * `issues` - read / write - * `packages` - read - * `pages` - read / write - * `pull_requests` - read / write - * `repository_projects` - read / write - * `statuses` - read / write - * `workflows` - write + 可以为列出的每个存储库授予任意数量的以下权限: + * `actions` - 读/写 + * `checks` - 读/写 + * `contents` - 读/写 + * `deployments` - 读/写 + * `discussions` - 读/写 + * `issues` - 读/写 + * `packages` - 读取 + * `pages` - 读/写 + * `pull_requests` - 读/写 + * `repository_projects` - 读/写 + * `statuses` - 读/写 + * `workflows` - 写入 - To set a permission for all repositories in an organization, use the `*` wildcard following your organization name in the `repositories` object. + 若要为组织中的所有存储库设置权限,请在 `repositories` 对象中在组织名称后面使用 `*` 通配符。 ```json { @@ -86,7 +91,7 @@ To create codespaces with custom permissions defined, you must use one of the fo } ``` - To set all permissions for a given repository, use `"permissions": "read-all"` or `"permissions": "write-all"` in the repository object. + 若要为给定存储库设置所有权限,请在存储库对象中使用 `"permissions": "read-all"` 或 `"permissions": "write-all"`。 ```json { @@ -102,32 +107,31 @@ To create codespaces with custom permissions defined, you must use one of the fo } ``` -## Authorizing requested permissions +## 授予请求的权限 -If additional repository permissions are defined in the `devcontainer.json` file, you will be prompted to review and optionally authorize the permissions when you create a codespace or a prebuild configuration for this repository. When you authorize permissions for a repository, {% data variables.product.prodname_github_codespaces %} will not re-prompt you unless the set of requested permissions has changed for the repository. +如果在 `devcontainer.json` 文件中定义了其他存储库权限,系统会提示你在为此存储库创建 codespace 或预生成配置时查看并选择性地授予权限。 为存储库授予权限后,除非为存储库请求的权限集已更改,否则 {% data variables.product.prodname_github_codespaces %} 不会重新提示你。 -![The requested permissions page](/assets/images/help/codespaces/codespaces-accept-permissions.png) +![请求的权限页](/assets/images/help/codespaces/codespaces-accept-permissions.png) -You should only authorize permissions for repositories you know and trust. If you don't trust the set of requested permissions, click **Continue without authorizing** to create the codespace with the base set of permissions. Rejecting additional permissions may impact the functionality of your project within the codespace as the codespace will only have access to the repository from which it was created. +应仅为你了解和信任的存储库授予权限。 如果你不信任请求的权限集,请单击“请继续操作,无需进行授权”以创建具有基本权限集的代码空间。 拒绝其他权限可能会影响代码空间中项目的功能,因为代码空间只能访问从中创建它的存储库。 -You can only authorize permissions that your personal account already possesses. If a codespace requests permissions for repositories that you don't currently have access to, contact an owner or admin of the repository to obtain sufficient access and then try to create a codespace again. +你只能授予个人帐户已拥有的权限。 如果代码空间请求你当前无权访问的存储库的权限,请联系存储库的所有者或管理员以获取足够的访问权限,然后尝试再次创建代码空间。 -## Access and security +## 访问和安全性 {% warning %} -**Deprecation note**: The access and security setting described below is now deprecated and is documented here for reference only. To enable expanded access to other repositories, add the requested permissions to your dev container definition for your codespace, as described above. +**停用说明**:下方描述的访问和安全设置现已停用,此处记录仅为参考。 若要启用对其他存储库的扩展访问权限,请将请求的权限添加到代码空间的开发容器定义,如上所述。 {% endwarning %} -When you enable access and security for a repository owned by your personal account, any codespaces that are created for that repository will have read permissions to all other repositories you own. If you want to restrict the repositories a codespace can access, you can limit to it to either the repository the codespace was opened for or specific repositories. You should only enable access and security for repositories you trust. +为个人帐户拥有的存储库启用访问和安全后,为该存储库创建的任何代码空间都将对你拥有的所有其他存储库具有读取权限。 如果要限制代码空间可以访问的仓库,您可以将其限制为代码空间打开的仓库或特定仓库。 您应该只对您信任的仓库启用访问和安全。 -{% data reusables.user-settings.access_settings %} -{% data reusables.user-settings.codespaces-tab %} -1. Under "Access and security", select the setting you want for your personal account. +{% data reusables.user-settings.access_settings %} {% data reusables.user-settings.codespaces-tab %} +1. 在“访问和安全”下,为个人帐户选择所需的设置。 - ![Radio buttons to manage trusted repositories](/assets/images/help/settings/codespaces-access-and-security-radio-buttons.png) + ![管理信任仓库的单选按钮](/assets/images/help/settings/codespaces-access-and-security-radio-buttons.png) -1. If you chose "Selected repositories", select the dropdown menu, then click a repository to allow the repository's codespaces to access other repositories you own. Repeat for all repositories whose codespaces you want to access other repositories you own. +1. 如果选择了“所选存储库”,请选择下拉菜单,然后单击一个存储库,以允许该存储库的 codespace 访问你拥有的其他存储库。 对于您要允许其代码空间访问您拥有的其他仓库的所有仓库重复此操作。 - !["Selected repositories" dropdown menu](/assets/images/help/settings/codespaces-access-and-security-repository-drop-down.png) + ![“所选存储库”下拉菜单](/assets/images/help/settings/codespaces-access-and-security-repository-drop-down.png) diff --git a/translations/zh-CN/content/codespaces/managing-your-codespaces/reviewing-your-security-logs-for-github-codespaces.md b/translations/zh-CN/content/codespaces/managing-your-codespaces/reviewing-your-security-logs-for-github-codespaces.md index 475292c833..03b3653a7e 100644 --- a/translations/zh-CN/content/codespaces/managing-your-codespaces/reviewing-your-security-logs-for-github-codespaces.md +++ b/translations/zh-CN/content/codespaces/managing-your-codespaces/reviewing-your-security-logs-for-github-codespaces.md @@ -1,7 +1,7 @@ --- -title: Reviewing your security logs for GitHub Codespaces +title: 查看 GitHub Codespaces 的安全日志 shortTitle: Security logs -intro: 'You can use the security log to review all actions related to {% data variables.product.prodname_github_codespaces %}.' +intro: '你可以使用安全日志查看与 {% data variables.product.prodname_github_codespaces %} 相关的所有操作。' versions: fpt: '*' ghec: '*' @@ -11,19 +11,22 @@ topics: - Security redirect_from: - /codespaces/managing-your-codespaces/reviewing-your-security-logs-for-codespaces +ms.openlocfilehash: 51cd11f123cbc2b6b67e089d65bc68d3441aa5b8 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159478' --- +## 关于 {% data variables.product.prodname_github_codespaces %} 的安全日志 - +当你在个人帐户拥有的存储库中执行与 {% data variables.product.prodname_github_codespaces %} 相关的操作时,你可以查看安全日志中的操作。 有关访问日志的详细信息,请参阅“[查看安全日志](/github/authenticating-to-github/reviewing-your-security-log#accessing-your-security-log)”。 -## About security logs for {% data variables.product.prodname_github_codespaces %} +![包含代码空间信息的安全日志](/assets/images/help/settings/codespaces-audit-log.png) -When you perform an action related to {% data variables.product.prodname_github_codespaces %} in repositories owned by your personal account, you can review the actions in the security log. For information about accessing the log, see "[Reviewing your security log](/github/authenticating-to-github/reviewing-your-security-log#accessing-your-security-log)." +安全日志包括发生了什么操作以及何时执行的操作等详细信息。 有关 {% data variables.product.prodname_github_codespaces %} 操作的信息,请参阅“[{% data variables.product.prodname_codespaces %} 类别操作](/github/authenticating-to-github/reviewing-your-security-log#codespaces-category-actions)”。 -![security log with Codespaces information](/assets/images/help/settings/codespaces-audit-log.png) +## 延伸阅读 -The security log includes details on what action occurred and when you performed it. For information about {% data variables.product.prodname_github_codespaces %} actions, see "[{% data variables.product.prodname_codespaces %} category actions](/github/authenticating-to-github/reviewing-your-security-log#codespaces-category-actions)". - -## Further reading - -- "[Reviewing your organization's audit logs for {% data variables.product.prodname_github_codespaces %}](/codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-github-codespaces)" -- "[{% data variables.product.prodname_github_codespaces %} logs](/codespaces/troubleshooting/github-codespaces-logs)" \ No newline at end of file +- “[查看 {% data variables.product.prodname_github_codespaces %} 的组织审核日志](/codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-github-codespaces)” +- “[{% data variables.product.prodname_github_codespaces %} 日志](/codespaces/troubleshooting/github-codespaces-logs)” diff --git a/translations/zh-CN/content/codespaces/overview.md b/translations/zh-CN/content/codespaces/overview.md index 5b70cd891d..1279edb699 100644 --- a/translations/zh-CN/content/codespaces/overview.md +++ b/translations/zh-CN/content/codespaces/overview.md @@ -15,12 +15,12 @@ versions: type: overview topics: - Codespaces -ms.openlocfilehash: a1618c86671bc5b06474c41803c6b34576a897aa -ms.sourcegitcommit: 2e1852bcdd690cb66b9b5d69cb056a2bb2b9a6b4 +ms.openlocfilehash: 9d01df3f8dae7ceb788e2dd57b02fb3cc977400d +ms.sourcegitcommit: 1529de77bfcbe45519131b5f5fb3ab319758c2d2 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 11/10/2022 -ms.locfileid: '148160798' +ms.lasthandoff: 11/14/2022 +ms.locfileid: '148164321' --- ## 什么是代码空间? @@ -50,7 +50,7 @@ ms.locfileid: '148160798' 组织所有者可以启用 {% data variables.product.prodname_github_codespaces %},后者可按照组织或企业帐户计费。 这适用于通过组织拥有的存储库创建的 codespaces。 有关详细信息,请参阅“[为组织启用 {% data variables.product.prodname_github_codespaces %}](/codespaces/managing-codespaces-for-your-organization/enabling-github-codespaces-for-your-organization)”。 可以对组织或企业帐户上的 {% data variables.product.prodname_github_codespaces %} 使用设置支出限制。 有关详细信息,请参阅“[管理 {% data variables.product.prodname_github_codespaces %} 的支出限制](/billing/managing-billing-for-github-codespaces/managing-the-spending-limit-for-github-codespaces)”。 -如果按照组织或企业对 codespace 的使用进行计费,则会在创建 codespace 时显示。 有关详细信息,请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)”。 按照组织或其父企业计费的 codespaces 归组织所有,且可被组织所有者删除。 有关详细信息,请参阅“[删除 codespace](/codespaces/developing-in-codespaces/deleting-a-codespace#deleting-codespaces-in-your-organization)”。 +如果按照组织或企业对 codespace 的使用进行计费,则会在创建 codespace 时显示。 有关详细信息,请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)”。 按照组织或其父企业计费的 codespace 归组织所有,且可被组织所有者删除。 有关详细信息,请参阅“[删除 codespace](/codespaces/developing-in-codespaces/deleting-a-codespace#deleting-codespaces-in-your-organization)”。 ### 自定义 {% data variables.product.prodname_github_codespaces %} diff --git a/translations/zh-CN/content/codespaces/prebuilding-your-codespaces/about-github-codespaces-prebuilds.md b/translations/zh-CN/content/codespaces/prebuilding-your-codespaces/about-github-codespaces-prebuilds.md index 45f4bd4c6b..c3d2e0b4af 100644 --- a/translations/zh-CN/content/codespaces/prebuilding-your-codespaces/about-github-codespaces-prebuilds.md +++ b/translations/zh-CN/content/codespaces/prebuilding-your-codespaces/about-github-codespaces-prebuilds.md @@ -1,7 +1,7 @@ --- -title: About GitHub Codespaces prebuilds +title: 关于 GitHub Codespaces 预生成 shortTitle: About prebuilds -intro: '{% data variables.product.prodname_github_codespaces %} prebuilds help to speed up the creation of new codespaces for large or complex repositories.' +intro: '{% data variables.product.prodname_github_codespaces %} 预生成有助于加快为大型或复杂存储库创建新的 codespace 的速度。' versions: fpt: '*' ghec: '*' @@ -9,43 +9,48 @@ topics: - Codespaces redirect_from: - /codespaces/prebuilding-your-codespaces/about-codespaces-prebuilds +ms.openlocfilehash: e0962e410f2227a23ff98c8a3e7995ea8ec8a914 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158795' --- - -## Overview +## 概述 {% data reusables.codespaces.prebuilds-definition %} -If it currently takes more than 2 minutes to create a codespace for a repository, you are likely to benefit from using prebuilds. This is because, with a prebuild, any source code, editor extensions, project dependencies, commands, and configurations have already been downloaded, installed, and applied before you create a codespace. +如果当前为存储库创建 codespace 的时间超过 2 分钟,则使用预生成可能会更好。 这是因为,使用预生成,会在创建 codespace 之前下载、安装和应用任何源代码、编辑器扩展、项目依赖项、命令和配置。 -By default, whenever you push changes to your repository, {% data variables.product.prodname_github_codespaces %} uses {% data variables.product.prodname_actions %} to automatically update your prebuilds. +默认情况下,每当将更改推送到存储库时,{% data variables.product.prodname_github_codespaces %} 都会使用 {% data variables.product.prodname_actions %} 自动更新预生成。 -When prebuilds are available for a particular branch of a repository, a particular dev container configuration file, and for your region, you'll see the "{% octicon "zap" aria-label="The zap icon" %} Prebuild ready" label in the list of machine type options when you create a codespace. If a prebuild is still being created, you will see the "{% octicon "history" aria-label="The history icon" %} Prebuild in progress" label. For more information, see "[Creating a codespace for a repository](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)." +当预生成可用于存储库的特定分支、特定开发容器配置文件和你所在的区域时,你会在创建 codespace 时在计算机类型选项列表中看到“{% octicon "zap" aria-label="The zap icon" %} 预生成就绪”标签。 如果仍在创建预生成,你将看到“{% octicon "history" aria-label="The history icon" %}正在进行预生成”标签。 有关详细信息,请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)”。 -![The dialog box for choosing a machine type](/assets/images/help/codespaces/choose-custom-machine-type.png) +![用于选择计算机类型的对话框](/assets/images/help/codespaces/choose-custom-machine-type.png) -When you create a codespace from a template on the "Your codespaces" page, {% data variables.product.prodname_dotcom %} may automatically use a prebuild to speed up creation time. For more information on templates, see "[Creating a codespace from a template](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template)." +根据“你的 codespace”页面上的模板创建 codespace 时,{% data variables.product.prodname_dotcom %} 可能会自动使用预生成来加快创建时间。 有关模板的详细信息,请参阅“[根据模板创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template)”。 -## The prebuild process +## 预生成过程 -To create a prebuild you set up a prebuild configuration. When you save the configuration, a {% data variables.product.prodname_actions %} workflow runs to create each of the required prebuilds; one workflow per prebuild. Workflows also run whenever the prebuilds for your configuration need to be updated. This can happen at scheduled intervals, on pushes to a prebuild-enabled repository, or when you change the dev container configuration. For more information, see "[Configuring prebuilds](/codespaces/prebuilding-your-codespaces/configuring-prebuilds#configuring-prebuilds)." +若要创建预生成,请设置预生成配置。 保存配置时,将运行 {% data variables.product.prodname_actions %} 工作流以创建每个所需的预生成;每个预生成一个工作流。 每当需要更新配置的预生成时,也会运行工作流。 在计划时间间隔、推送到已启用预生成的存储库时或更改开发容器配置时可能会发生这种情况。 有关详细信息,请参阅“[配置预生成](/codespaces/prebuilding-your-codespaces/configuring-prebuilds#configuring-prebuilds)”。 -When a prebuild configuration workflow runs, {% data variables.product.prodname_dotcom %} creates a temporary codespace, performing setup operations up to and including any `onCreateCommand` and `updateContentCommand` commands in the `devcontainer.json` file. No `postCreateCommand` commands are run during the creation of a prebuild. For more information about these commands, see the [`devcontainer.json` reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_devcontainerjson-properties) in the {% data variables.product.prodname_vscode_shortname %} documentation. A snapshot of the generated container is then taken and stored. +运行预生成配置工作流时,{% data variables.product.prodname_dotcom %} 会创建临时 codespace,从而执行直到 `devcontainer.json` 文件中的任何 `onCreateCommand` 和 `updateContentCommand` 命令(含)的设置操作。 在创建预生成期间不会运行任何 `postCreateCommand` 命令。 有关使用这些命令的详细信息,请参阅 {% data variables.product.prodname_vscode_shortname %} 文档中的 [`devcontainer.json` 参考](https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_devcontainerjson-properties)。 然后创建并存储生成的容器的快照。 -As with other {% data variables.product.prodname_actions %} workflows, running a prebuild configuration workflow will either consume some of the {% data variables.product.prodname_actions %} minutes included with your account, if you have any, or it will incur charges for {% data variables.product.prodname_actions %} minutes. Storage of codespace prebuilds is billed in the same way as storage of active or stopped codespaces. For more information, see "[About billing for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#billing-for-codespaces-prebuilds)." +与其他 {% data variables.product.prodname_actions %} 工作流一样,运行预生成配置工作流会占用帐户中包含的一些 {% data variables.product.prodname_actions %} 分钟(如果有),或者会产生 {% data variables.product.prodname_actions %} 分钟的费用。 存储 codespace 预生成的计费方式与存储活动或已停止的 codespace 相同。 有关详细信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#billing-for-codespaces-prebuilds)”。 -When you create a codespace from a prebuild, {% data variables.product.prodname_dotcom %} downloads the existing container snapshot from storage and deploys it on a fresh virtual machine, completing the remaining commands specified in the dev container configuration. Since many operations have already been performed, such as cloning the repository, creating a codespace from a prebuild can be substantially quicker than creating one without a prebuild. This is true where the repository is large and/or `onCreateCommand` commands take a long time to run. +从预生成创建 codespace 时,{% data variables.product.prodname_dotcom %} 从存储下载现有容器快照,并将其部署到全新的虚拟机上,从而完成开发容器配置中指定的剩余命令。 由于已执行许多操作(例如克隆存储库),因此从预生成创建 codespace 可能比在没有预生成的情况下创建 codespace 要快得多。 存储库很大和/或 `onCreateCommand` 命令的运行时间很长时会出现这种情况。 -## About pushing changes to prebuild-enabled branches +## 关于将更改推送到已启用预生成的分支 -By default, each push to a branch that has a prebuild configuration results in a {% data variables.product.prodname_dotcom %}-managed {% data variables.product.prodname_actions %} workflow run to update the prebuild. The prebuild workflow has a concurrency limit of one workflow run at a time for a given prebuild configuration, unless changes were made that affect the dev container configuration for the associated repository. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)." If a run is already in progress, the workflow run that was queued most recently queued will run next, after the current run completes. +默认情况下,每次推送到有预生成配置的分支,都会运行一个 {% data variables.product.prodname_dotcom %} 托管的 {% data variables.product.prodname_actions %} 工作流来更新预生成。 预生成工作流有一个并发限制,即,对于一个给定的预生成配置,一次只能运行一个工作流,除非进行的更改影响到相关存储库的开发容器配置。 有关详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)”。 如果运行已在进行中,则最近排队的工作流运行将在当前运行完成后运行。 -With the prebuild set to be updated on each push, it means that if there are very frequent pushes to your repository, prebuild updates will occur at least as often as it takes to run the prebuild workflow. That is, if your workflow run typically takes one hour to complete, prebuilds will be created for your repository roughly hourly, if the run succeeds, or more often if there were pushes that change the dev container configuration on the branch. +将预生成设置为在每次推送时更新,意味着如果存储库中存在非常频繁的推送,预生成更新将至少与运行预生成工作流所需的频率一样频繁。 也就是说,如果工作流运行通常需要一个小时才能完成且运行成功,那么大约每小时会为存储库创建一次预生成,如果分支上有更改开发容器配置的推送,则创建预生成会更频繁。 -For example, let's imagine 5 pushes are made, in quick succession, against a branch that has a prebuild configuration. In this situation: +例如,假设针对有预生成配置的分支连续进行 5 次推送。 在这种情况下: -* A workflow run is started for the first push, to update the prebuild. -* If the 4 remaining pushes do not affect the dev container configuration, the workflow runs for these are queued in a "pending" state. +* 在第一次推送中会启动工作流运行,以更新预生成。 +* 如果余下的 4 次推送不会影响开发容器配置,这些工作流运行将以“挂起”状态排队。 - If any of the remaining 4 pushes change the dev container configuration, then the service will not skip that one and will immediately run the prebuild creation workflow, updating the prebuild accordingly if it succeeds. + 如果余下 4 次推送中的任何一次更改了开发容器配置,服务将不会跳过该推送,并将立即运行预生成创建工作流,运行成功后将相应地更新预生成。 -* Once the first run completes, workflow runs for pushes 2, 3, and 4 will be canceled, and the last queued workflow (for push 5) will run and update the prebuild. +* 首次运行完成后,将取消第 2、3 和 4 次推送的工作流运行,最后排队的工作流(第 5 次推送)将运行并更新预生成。 diff --git a/translations/zh-CN/content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md b/translations/zh-CN/content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md index d8302ff3d2..d3f5b30354 100644 --- a/translations/zh-CN/content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md +++ b/translations/zh-CN/content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md @@ -1,7 +1,7 @@ --- -title: Managing prebuilds +title: 管理预生成 shortTitle: Manage prebuilds -intro: 'You can review, modify, and delete the prebuild configurations for your repository.' +intro: 你可以查看、修改和删除存储库的预生成配置。 versions: fpt: '*' ghec: '*' @@ -9,90 +9,95 @@ type: how_to topics: - Codespaces miniTocMaxHeadingLevel: 3 +ms.openlocfilehash: f39c46d91193db4c1c44ab336d86024b40adcea4 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159514' --- +## 检查、更改和删除预生成配置 -## Checking, changing, and deleting your prebuild configurations +为存储库配置的预生成是使用 {% data variables.product.prodname_actions %} 工作流(由 {% data variables.product.prodname_github_codespaces %} 服务管理)创建和更新的。 -The prebuilds that you configure for a repository are created and updated using a {% data variables.product.prodname_actions %} workflow, managed by the {% data variables.product.prodname_github_codespaces %} service. +根据预生成配置中的设置,更新预生成的工作流可能会由以下事件触发: -Depending on the settings in a prebuild configuration, the workflow to update the prebuild may be triggered by these events: +* 创建或更新预生成配置 +* 将提交或拉取请求推送到配置为具有预生成的分支 +* 更改任何开发容器配置文件 +* 在预生成配置中定义的计划 +* 手动触发工作流 -* Creating or updating the prebuild configuration -* Pushing a commit or a pull request to a branch that's configured to have prebuilds -* Changing any of the dev container configuration files -* A schedule that you've defined in the prebuild configuration -* Manually triggering the workflow +预生成配置中的设置确定哪些事件会自动触发预生成的更新。 有关详细信息,请参阅“[配置预生成](/codespaces/prebuilding-your-codespaces/configuring-prebuilds#configuring-prebuilds)”。 -The settings in the prebuild configuration determine which events automatically trigger an update of the prebuild. For more information, see "[Configuring prebuilds](/codespaces/prebuilding-your-codespaces/configuring-prebuilds#configuring-prebuilds)." +具有存储库管理员访问权限的人员可以检查预生成的进度以及编辑和删除预生成配置。 -People with admin access to a repository can check the progress of prebuilds, edit, and delete prebuild configurations. +### 查看预生成的进度 +可以在存储库设置的 {% data variables.product.prodname_github_codespaces %} 页上查看所设置的每个预生成配置的最新工作流运行的当前状态。 例如,“当前正在运行”或“1 小时前最后一次运行”。 -### Viewing the progress of prebuilds -You can view the current status of the latest workflow run for each prebuild configuration you've set up on the {% data variables.product.prodname_github_codespaces %} page of your repository settings. For example, "Currently running" or "Last run 1 hour ago." +若要查看最新预生成工作流运行的日志输出,请单击“查看输出”。 -To see the log output for the latest prebuild workflow run, click **See output**. +![“查看输出”按钮](/assets/images/help/codespaces/prebuilds-see-output.png) -![The 'See output' button](/assets/images/help/codespaces/prebuilds-see-output.png) +这会在“操作”选项卡中显示工作流的最近一次运行的输出。 -This displays the output of the most recent run of the workflow in the **Actions** tab. +![预生成工作流输出](/assets/images/help/codespaces/prebuilds-log-output.png) -![The prebuild workflow output](/assets/images/help/codespaces/prebuilds-log-output.png) +或者,若要查看与指定分支关联的所有预生成工作流运行,请单击省略号按钮,然后从下拉菜单中选择“查看运行”。 -Alternatively, to view all prebuild workflow runs associated with the specified branch, click the ellipsis button and choose **View runs** from the dropdown menu. +![下拉菜单中的“查看运行”选项](/assets/images/help/codespaces/prebuilds-view-runs.png) -![The 'View runs' option in the dropdown menu](/assets/images/help/codespaces/prebuilds-view-runs.png) +这将显示关联分支的预生成工作流运行历史记录。 -This displays the workflow run history for prebuilds for the associated branch. +![工作流运行历史记录](/assets/images/help/codespaces/prebuilds-workflow-runs.png) -![The workflow run history](/assets/images/help/codespaces/prebuilds-workflow-runs.png) +### 编辑预生成配置 -### Editing a prebuild configuration - -1. On the {% data variables.product.prodname_codespaces %} page of your repository settings, click the ellipsis to the right of the prebuild configuration you want to edit. -1. In the dropdown menu, click **Edit**. +1. 在存储库设置的 {% data variables.product.prodname_codespaces %} 页上,单击要编辑的预生成配置右侧的省略号。 +1. 在下拉菜单中,单击“编辑”。 - ![The 'Edit' option in the dropdown menu](/assets/images/help/codespaces/prebuilds-edit.png) + ![下拉菜单中的“编辑”选项](/assets/images/help/codespaces/prebuilds-edit.png) -1. Make the required changes to the prebuild configuration, then click **Update**. +1. 对预生成配置进行所需的更改,然后单击“更新”。 {% data reusables.codespaces.prebuilds-permission-authorization %} -### Disabling a prebuild configuration +### 禁用预生成配置 -To pause the update of prebuilds for a configuration, you can disable workflow runs for the configuration. Disabling the workflow runs for a prebuild configuration does not delete any previously created prebuilds for that configuration and, as a result, codespaces will continue to be generated from an existing prebuild. +若要暂停更新配置的预生成,可以禁用配置的工作流运行。 为预生成配置禁用工作流运行不会删除以前为该配置创建的任何预生成,因此,codespace 将继续从现有预生成生成。 -Disabling the workflow runs for a prebuild configuration is useful if you need to investigate prebuild creation failures. +如果需要调查预生成创建失败,则禁用预生成配置的工作流运行非常有用。 -1. On the {% data variables.product.prodname_codespaces %} page of your repository settings, click the ellipsis to the right of the prebuild configuration you want to disable. -1. In the dropdown menu, click **Disable runs**. +1. 在存储库设置的 {% data variables.product.prodname_codespaces %} 页上,单击要禁用的预生成配置右侧的省略号。 +1. 在下拉菜单中,单击“禁用运行”。 - ![The 'Disable runs' option in the dropdown menu](/assets/images/help/codespaces/prebuilds-disable.png) + ![下拉菜单中的“禁用运行”选项](/assets/images/help/codespaces/prebuilds-disable.png) -1. To confirm that you want to disable this configuration, click **OK**. +1. 若确认要禁用此配置,请单击“确定”。 -### Deleting a prebuild configuration +### 删除预生成配置 -Deleting a prebuild configuration also deletes all previously created prebuilds for that configuration. As a result, shortly after you delete a configuration, prebuilds generated by that configuration will no longer be available when you create a new codespace. +删除预生成配置还会删除以前为该配置创建的所有预生成。 因此,删除配置后不久,在创建新 codespace 时,该配置生成的预生成将不再可用。 -After you delete a prebuild configuration, workflow runs for that configuration that have been queued or started will still run. They will be listed in the workflow run history, along with previously completed workflow runs. +删除预生成配置后,该配置已排队或启动的工作流仍将运行。 它们将连同以前完成的工作流运行一起列在工作流运行历史记录中。 -1. On the {% data variables.product.prodname_codespaces %} page of your repository settings, click the ellipsis to the right of the prebuild configuration you want to delete. -1. In the dropdown menu, click **Delete**. +1. 在存储库设置的 {% data variables.product.prodname_codespaces %} 页上,单击要删除的预生成配置右侧的省略号。 +1. 在下拉菜单中,单击“删除”。 - ![The 'Delete' option in the dropdown menu](/assets/images/help/codespaces/prebuilds-delete.png) + ![下拉菜单中的“删除”选项](/assets/images/help/codespaces/prebuilds-delete.png) -1. Click **OK** to confirm the deletion. +1. 单击“确定”确认删除操作。 -### Manually trigger prebuilds +### 手动触发预生成 -It may be useful to manually trigger a workflow run for a prebuild configuration. Generally this is only necessary if you are debugging a problem with the workflow for a prebuild configuration. +手动触发预生成配置的工作流运行可能很有用。 通常,只有在调试预生成配置的工作流的问题时,才有必要这样做。 -1. On the {% data variables.product.prodname_codespaces %} page of your repository settings, click the ellipsis to the right of the prebuild configuration whose workflow you want to trigger. -1. In the dropdown menu, click **Manually trigger**. +1. 在存储库设置的 {% data variables.product.prodname_codespaces %} 页上,单击要触发其工作流的预生成配置右侧的省略号。 +1. 在下拉菜单中,单击“手动触发”。 - ![The 'Manually trigger' option in the dropdown menu](/assets/images/help/codespaces/prebuilds-manually-trigger.png) + ![下拉菜单中的“手动触发”选项](/assets/images/help/codespaces/prebuilds-manually-trigger.png) -## Further reading +## 延伸阅读 -- "[Troubleshooting prebuilds](/codespaces/troubleshooting/troubleshooting-prebuilds)" +- [对预生成进行故障排除](/codespaces/troubleshooting/troubleshooting-prebuilds) diff --git a/translations/zh-CN/content/codespaces/prebuilding-your-codespaces/testing-dev-container-changes.md b/translations/zh-CN/content/codespaces/prebuilding-your-codespaces/testing-dev-container-changes.md index 11b834bce3..9b34304894 100644 --- a/translations/zh-CN/content/codespaces/prebuilding-your-codespaces/testing-dev-container-changes.md +++ b/translations/zh-CN/content/codespaces/prebuilding-your-codespaces/testing-dev-container-changes.md @@ -1,8 +1,8 @@ --- -title: Testing dev container configuration changes on a prebuild-enabled branch +title: 在已启用预生成的分支上测试开发容器配置更改 shortTitle: Test dev container changes allowTitleToDifferFromFilename: true -intro: When you change the dev container configuration for a branch that's enabled for prebuilds you should test your changes in a codespace. +intro: 更改为预生成启用的分支的开发容器配置时,应在 codespace 中测试更改。 versions: fpt: '*' ghec: '*' @@ -11,22 +11,27 @@ topics: - Codespaces - Set up permissions: People with write permissions to a repository can create or edit the dev container configuration for a branch. +ms.openlocfilehash: 29b44d0fb0b3bb3211f0c204cc7e99e39ab89b79 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159423' --- +对已启用预生成的分支的开发容器配置所做的任何更改都会导致对 codespace 配置和关联的预生成进行更新。 因此,在将更改提交到主动使用的存储库分支之前,在 codespace 中从测试分支测试此类更改非常重要。 这将确保你不会为团队引入中断性变更。 -Any changes you make to the dev container configuration for a prebuild-enabled branch will result in an update to the codespace configuration and the associated prebuild. It’s therefore important to test such changes in a codespace from a test branch before committing your changes to a branch of your repository that's actively used. This will ensure you’re not introducing breaking changes for your team. +有关详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)”。 -For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)." +## 测试对开发容器配置的更改 -## Testing changes to the dev container configuration - -1. Create a codespace from the prebuild-enabled branch whose dev container you want to change. For more information, see "[Creating a codespace for a repository](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)." -1. In the codespace, check out a test branch. For more information, see "[Using source control in your codespace](/codespaces/developing-in-codespaces/using-source-control-in-your-codespace#creating-or-switching-branches)." -1. Make the required changes to the dev container configuration. -1. Apply the changes by rebuilding the container. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#applying-configuration-changes-to-a-codespace)." -1. After everything looks good, we also recommend creating a new codespace from your test branch to ensure everything is working. You can then commit your changes to your repository's default branch, or an active feature branch, triggering an update of the prebuild for that branch. +1. 从想要更改其开发容器的已启用预生成的分支中创建 codespace。 有关详细信息,请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)”。 +1. 在 codespace 中,签出测试分支。 有关详细信息,请参阅[在 codespace 中使用源代码管理](/codespaces/developing-in-codespaces/using-source-control-in-your-codespace#creating-or-switching-branches)。 +1. 对开发容器配置进行所需的更改。 +1. 通过重新生成容器来应用更改。 有关详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#applying-configuration-changes-to-a-codespace)”。 +1. 一切正常之后,我们还建议从测试分支创建新的 codespace,以确保一切正常工作。 然后,可以将更改提交到存储库的默认分支或活动功能分支,从而触发该分支的预生成的更新。 {% note %} - **Note**: Creating this codespace will take longer than usual because it will not be created from a prebuild. + 注意:创建此 codespace 所需的时间比平时长,因为它不会从预生成创建。 {% endnote %} diff --git a/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/adding-features-to-a-devcontainer-file.md b/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/adding-features-to-a-devcontainer-file.md new file mode 100644 index 0000000000..f14fd52369 --- /dev/null +++ b/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/adding-features-to-a-devcontainer-file.md @@ -0,0 +1,79 @@ +--- +title: Adding features to a devcontainer.json file +shortTitle: Adding features +intro: With features, you can quickly add tools, runtimes, or libraries to your dev container configuration. +allowTitleToDifferFromFilename: true +versions: + fpt: '*' + ghec: '*' +type: how_to +topics: + - Codespaces + - Set up +--- + +{% data reusables.codespaces.about-features %} Use the tabs in this article to display instructions for each of these ways of adding features. + +## Adding features to a `devcontainer.json` file + +{% webui %} + +1. Navigate to your repository on {% data variables.product.prodname_dotcom_the_website %}, find your `devcontainer.json` file, and click {% octicon "pencil" aria-label="The edit icon" %} to edit the file. + + If you don't already have a `devcontainer.json` file, you can create one now. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#creating-a-custom-dev-container-configuration)." +1. To the right of the file editor, in the **Marketplace** tab, browse or search for the feature you want to add, then click the name of the feature. + + ![Screenshot of the Terraform feature in the Marketplace tab, with "Terra" in the search bar](/assets/images/help/codespaces/feature-marketplace.png) +3. Under "Installation," click the code snippet to copy it to your clipboard, then paste the snippet into the `features` object in your `devcontainer.json` file. + + ![Screenshot of a code block in the Installation section of the Marketplace tab](/assets/images/help/codespaces/feature-installation-code.png) + + ```JSON + "features": { + ... + "ghcr.io/devcontainers/features/terraform:1": {}, + ... + } + ``` +1. By default, the latest version of the feature will be used. To choose a different version, or configure other options for the feature, expand the properties listed under "Options" to view the available values, then add the options by manually editing the object in your `devcontainer.json` file. + + ![Screenshot of the Options section of the Marketplace tab, with "version" and "tflint" expanded](/assets/images/help/codespaces/feature-options.png) + + ```JSON + "features": { + ... + "ghcr.io/devcontainers/features/terraform:1": { + "version": "1.1", + "tflint": "latest" + }, + ... + } + ``` +1. Commit the changes to your `devcontainer.json` file. + +The configuration changes will take effect in new codespaces created from the repository. To make the changes take effect in existing codespaces, you will need to pull the updates to the `devcontainer.json` file into your codespace, then rebuild the container for the codespace. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#applying-configuration-changes-to-a-codespace)." + +{% endwebui %} + +{% vscode %} + +{% note %} + +To add features in {% data variables.product.prodname_vscode_shortname %} while you are working locally, and not connected to a codespace, you must have the "Dev Containers" extension installed and enabled. For more information about this extension, see the [{% data variables.product.prodname_vs_marketplace_shortname %}](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers). + +{% endnote %} + +{% data reusables.codespaces.command-pallette %} +2. Start typing "Configure" and select **Codespaces: Configure Dev Container Features**. + + ![The Configure Devcontainer Features command in the Command Palette](/assets/images/help/codespaces/codespaces-configure-features.png) + +3. Update your feature selections, then click **OK**. + + ![The select additional features menu during container configuration](/assets/images/help/codespaces/select-additional-features.png) + +4. If you're working in a codespace, a prompt will appear in the lower-right corner. To rebuild the container and apply the changes to the codespace you're working in, click **Rebuild Now**. + + !["Codespaces: Rebuild Container" in the Command Palette](/assets/images/help/codespaces/rebuild-prompt.png) + +{% endvscode %} \ No newline at end of file diff --git a/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers.md b/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers.md index 70f431a081..c33380d1e2 100644 --- a/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers.md +++ b/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers.md @@ -1,6 +1,6 @@ --- -title: Introduction to dev containers -intro: 'When you work in a codespace, the environment you are working in is created using a development container, or dev container, hosted on a virtual machine.' +title: 开发容器简介 +intro: 在 codespace 中工作时,你工作所处的环境是使用托管在虚拟机上的开发容器创建的。 permissions: People with write permissions to a repository can create or edit the codespace configuration. redirect_from: - /github/developing-online-with-github-codespaces/configuring-github-codespaces-for-your-project @@ -16,71 +16,76 @@ topics: - Codespaces - Set up - Fundamentals +ms.openlocfilehash: 0b47f0292eb3a13467a8227ac323d289f9712223 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158771' --- +## 关于开发容器 -## About dev containers +开发容器是 Docker 容器,是为了提供功能齐全的开发环境专门配置的。 只要在 codespace 中运作,都是在虚拟机上使用开发容器。 -Development containers, or dev containers, are Docker containers that are specifically configured to provide a fully featured development environment. Whenever you work in a codespace, you are using a dev container on a virtual machine. +可以为存储库配置开发容器,以便为该存储库创建的 codespace 能够为你提供定制的开发环境,其中包含处理特定项目所需的所有工具和运行时。 如果未在存储库中定义配置,则 {% data variables.product.prodname_github_codespaces %} 使用默认配置,其中包含团队在开发项目时可能需要的许多常用工具。 有关详细信息,请参阅“[使用默认开发容器配置](#using-the-default-dev-container-configuration)”。 -You can configure the dev container for a repository so that codespaces created for that repository give you a tailored development environment, complete with all the tools and runtimes you need to work on a specific project. If you don't define a configuration in the repository then {% data variables.product.prodname_github_codespaces %} uses a default configuration, which contains many of the common tools that your team might need for development with your project. For more information, see "[Using the default dev container configuration](#using-the-default-dev-container-configuration)." +开发容器的配置文件包含在存储库的 `.devcontainer` 目录中。 可以使用 {% data variables.product.prodname_vscode %} 为你添加配置文件。 可以从各种项目类型的预定义配置中进行选择。 无需进一步配置即可使用这些配置,也可以编辑这些配置以优化它们生成的开发环境。 有关详细信息,请参阅“[使用预定义的开发容器配置](#using-a-predefined-dev-container-configuration)”。 -The configuration files for a dev container are contained in a `.devcontainer` directory in your repository. You can use {% data variables.product.prodname_vscode %} to add configuration files for you. You can choose from a selection of predefined configurations for various project types. You can use these without further configuration, or you can edit the configurations to refine the development environment they produce. For more information, see "[Using a predefined dev container configuration](#using-a-predefined-dev-container-configuration)." +或者,可以添加自己的自定义配置文件。 有关详细信息,请参阅“[创建自定义开发容器配置](#creating-a-custom-dev-container-configuration)”。 -Alternatively, you can add your own custom configuration files. For more information, see "[Creating a custom dev container configuration](#creating-a-custom-dev-container-configuration)." +可以为存储库定义单个开发容器配置、为不同分支定义不同配置或多个配置。 当有多个配置可用时,用户可以在创建 codespace 时选择其首选配置。 这对于包含不同编程语言或不同项目的源代码的大型存储库尤其有用。 你可以创建一个配置选择,允许不同的团队使用为他们正在进行的工作设置的相应 codespace。 -You can define a single dev container configuration for a repository, different configurations for different branches, or multiple configurations. When multiple configurations are available, users can choose their preferred configuration when they create a codespace. This is particularly useful for large repositories that contain source code in different programming languages or for different projects. You can create a choice of configurations that allow different teams to work in a codespace that's set up appropriately for the work they are doing. - -When you create a codespace from a template, you might start with one or more dev container configuration files in your workspace. To configure your environment further, you can add or remove settings from these files and rebuild the container to apply the changes to the codespace you're working in. If you publish your codespace to a repository on {% data variables.product.product_name %}, then any codespaces created from that repository will share the configuration you've defined. For more information, see "[Applying configuration changes to a codespace](#applying-configuration-changes-to-a-codespace)" and "[Creating a codespace from a template](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template#publishing-to-a-remote-repository)." +根据模板创建 codespace 时,可以从工作区中的一个或多个开发容器配置文件开始。 若要进一步配置环境,可以从这些文件添加或删除设置,并重新生成容器,将更改应用到你正在使用的 codespace。 如果将 codespace 发布到 {% data variables.product.product_name %} 上的存储库,则从该存储库创建的任何 codespace 都将共享已定义的配置。 有关详细信息,请参阅“[将配置更改应用于 codespace](#applying-configuration-changes-to-a-codespace)”和“[根据模板创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template#publishing-to-a-remote-repository)”。 ### devcontainer.json -The primary file in a dev container configuration is the `devcontainer.json` file. You can use this file to determine the environment of codespaces created for your repository. The contents of this file define a dev container that can include frameworks, tools, extensions, and port forwarding. The `devcontainer.json` file usually contains a reference to a Dockerfile, which is typically located alongside the `devcontainer.json` file. +开发容器配置中的主文件是 `devcontainer.json` 文件。 可以使用此文件来确定为存储库创建的 codespace 环境。 此文件的内容定义了开发容器,它可以包括框架、工具、扩展和端口转发。 `devcontainer.json` 文件通常包含对 Dockerfile 的引用,Dockerfile 通常与 `devcontainer.json` 文件放在一起。 -If you create a codespace from a repository without a `devcontainer.json` file, or if you start from {% data variables.product.company_short %}'s blank template, the default dev container configuration is used. For more information, see "[Using the default dev container configuration](#using-the-default-dev-container-configuration)." +如果从没有 `devcontainer.json` 文件的存储库创建 codespace,或者根据 {% data variables.product.company_short %} 的空白模板创建,则使用默认的开发容器配置。 有关详细信息,请参阅“[使用默认开发容器配置](#using-the-default-dev-container-configuration)”。 -The `devcontainer.json` file is usually located in the `.devcontainer` directory of your repository. Alternatively, you can locate it directly in the root of the repository, in which case the file name must begin with a period: `.devcontainer.json`. +`devcontainer.json` 文件通常位于存储库的 `.devcontainer` 目录中。 或者,可以直接在存储库的根目录中找到它,在这种情况下,文件名必须以句点开头:`.devcontainer.json`。 -If you want to have a choice of dev container configurations in your repository, any alternatives to the `.devcontainer/devcontainer.json` (or `.devcontainer.json`) file must be located in their own subdirectory at the path `.devcontainer/SUBDIRECTORY/devcontainer.json`. For example, you could have a choice of two configurations: +如果要在存储库中选择开发容器配置,则 `.devcontainer/devcontainer.json`(或 `.devcontainer.json`)文件的任何替代文件都必须位于路径 `.devcontainer/SUBDIRECTORY/devcontainer.json` 处它们自己的子目录中。 例如,可以选择两种配置: * `.devcontainer/database-dev/devcontainer.json` * `.devcontainer/gui-dev/devcontainer.json` -When you have multiple `devcontainer.json` files in your repository, each codespace is created from only one of the configurations. Settings cannot be imported or inherited between `devcontainer.json` files. If a `devcontainer.json` file in a custom subdirectory has dependent files, such as the Dockerfile or scripts that are run by commands in the `devcontainer.json` file, it's recommended that you co-locate these files in the same subdirectory. +当存储库中有多个 `devcontainer.json` 文件时,每个 codespace 仅从其中一种配置创建。 无法在 `devcontainer.json` 文件之间导入或继承设置。 如果自定义子目录中的 `devcontainer.json` 文件具有依赖文件(例如 Dockerfile 或由 `devcontainer.json` 文件中的命令运行的脚本),建议将这些文件放在同一子目录中。 -For information about how to choose your preferred dev container configuration when you create a codespace, see "[Creating a codespace for a repository](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)." +有关如何在创建 codespace 时选择首选的开发容器配置的信息,请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)”。 {% data reusables.codespaces.more-info-devcontainer %} -#### How to use the devcontainer.json +#### 如何使用 devcontainer.json -It's useful to think of the `devcontainer.json` file as providing "customization" rather than "personalization." You should only include things that everyone working on your codebase needs as standard elements of the development environment, not things that are personal preferences. Things like linters are good to standardize on, and to require everyone to have installed, so they're good to include in your `devcontainer.json` file. Things like user interface decorators or themes are personal choices that should not be put in the `devcontainer.json` file. +将 `devcontainer.json` 文件视为提供“自定义”而不是“个性化”很有用。 你应仅包括每个人处理代码库都需要的内容(而不是个人偏好的内容),将它们作为开发环境的标准元素。 Linter 等内容非常适合标准化,并且要求每个人都安装,因此它们很适合包含在 `devcontainer.json` 文件中。 用户界面装饰器或主题等内容属于个人选择,不应放入 `devcontainer.json` 文件中。 -You can personalize your codespaces by using dotfiles and Settings Sync. For more information, see "[Personalizing {% data variables.product.prodname_github_codespaces %} for your account](/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account)." +可以使用点文件和设置同步对 codespace 进行个性化设置。有关详细信息,请参阅“[为帐户设置个性化的 {% data variables.product.prodname_github_codespaces %}](/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account)”。 ### Dockerfile -You can add a Dockerfile as part of your dev container configuration. +可以将 Dockerfile 添加为开发容器配置的一部分。 -The Dockerfile is a text file that contains the instructions needed to create a Docker container image. This image is used to generate a development container each time someone creates a codespace using the `devcontainer.json` file that references this Dockerfile. The instructions in the Dockerfile typically begin by referencing a parent image on which the new image that will be created is based. This is followed by commands that are run during the image creation process, for example to install software packages. +Dockerfile 是一个文本文件,其中包含创建 Docker 容器映像所需的指令。 每次有人使用引用此 Dockerfile 的 `devcontainer.json` 文件创建 codespace 时,此映像用于生成开发容器。 Dockerfile 中的指令通常以引用将创建的新映像所基于的父映像开始。 随后是在映像创建过程中运行的命令,例如安装软件包。 -The Dockerfile for a dev container is typically located in the `.devcontainer` folder, alongside the `devcontainer.json` in which it is referenced. +开发容器的 Dockerfile 通常位于 `.devcontainer` 文件夹中,引用它的 `devcontainer.json` 也在其中。 {% note %} -**Note**: As an alternative to using a Dockerfile you can use the `image` property in the `devcontainer.json` file to refer directly to an existing image you want to use. The image you specify here must be allowed by any organization image policy that has been set. For more information, see "[Restricting the base image for codespaces](/codespaces/managing-codespaces-for-your-organization/restricting-the-base-image-for-codespaces)." If neither a Dockerfile nor an image is found then the default container image is used. For more information, see "[Using the default dev container configuration](#using-the-default-dev-container-configuration)." +注意:作为使用 Dockerfile 的替代方法,可以使用 `devcontainer.json` 文件中的 `image` 属性直接引用要使用的现有映像。 已设置的任何组织映像策略都必须允许在此处指定的映像。 有关详细信息,请参阅“[限制 codespace 的基础映像](/codespaces/managing-codespaces-for-your-organization/restricting-the-base-image-for-codespaces)”。 如果找不到 Dockerfile 和映像,则使用默认容器映像。 有关详细信息,请参阅“[使用默认开发容器配置](#using-the-default-dev-container-configuration)”。 {% endnote %} -#### Simple Dockerfile example +#### 简单的 Dockerfile 示例 -The following example uses four instructions: +以下示例使用四个指令: -`ARG` defines a build-time variable. +`ARG` 定义生成时变量。 -`FROM` specifies the parent image on which the generated Docker image will be based. +`FROM` 指定生成的 Docker 映像所基于的父映像。 -`COPY` copies a file and adds it to the filesystem. +`COPY` 复制文件并将其添加到文件系统。 -`RUN` updates package lists and runs a script. You can also use a `RUN` instruction to install software, as shown by the commented out instructions. To run multiple commands, use `&&` to combine the commands into a single `RUN` statement. +`RUN` 更新包列表并运行脚本。 还可以使用 `RUN` 指令来安装软件,如注释掉的说明所示。 若要运行多个命令,请使用 `&&` 将命令组合成一个 `RUN` 语句。 ```Dockerfile{:copy} ARG VARIANT="16-buster" @@ -97,11 +102,11 @@ COPY library-scripts/github-debian.sh /tmp/library-scripts/ RUN apt-get update && bash /tmp/library-scripts/github-debian.sh ``` -For more information about Dockerfile instructions, see "[Dockerfile reference](https://docs.docker.com/engine/reference/builder)" in the Docker documentation. +有关 Dockerfile 指令的详细信息,请参阅 Docker 文档中的“[Dockerfile 参考](https://docs.docker.com/engine/reference/builder)”。 -#### Using a Dockerfile +#### 使用 Dockerfile -To use a Dockerfile as part of a dev container configuration, reference it in your `devcontainer.json` file by using the `dockerfile` property. +若要将 Dockerfile 用作开发容器配置的一部分,请使用 `dockerfile` 属性在 `devcontainer.json` 文件中引用它。 ```json{:copy} { @@ -111,130 +116,130 @@ To use a Dockerfile as part of a dev container configuration, reference it in yo } ``` -Various options are available to you if you want to use existing container orchestration in your dev container. For more information, see the "Orchestration options" section of the [Specification](https://containers.dev/implementors/spec/#orchestration-options) on the Development Containers website. +如果要在开发容器中使用现有容器业务流程,可以使用多种选项。 有关详细信息,请参阅开发容器网站上[规范](https://containers.dev/implementors/spec/#orchestration-options)中的“业务流程选项”部分。 -## Using the default dev container configuration +## 使用默认开发容器配置 -If you don't define a configuration in your repository, {% data variables.product.prodname_dotcom %} creates a codespace using a default Linux image. This Linux image includes a number of runtime versions for popular languages like Python, Node, PHP, Java, Go, C++, Ruby, and .NET Core/C#. The latest or LTS releases of these languages are used. There are also tools to support data science and machine learning, such as JupyterLab and Conda. The image also includes other developer tools and utilities like Git, GitHub CLI, yarn, openssh, and vim. To see all the languages, runtimes, and tools that are included use the `devcontainer-info content-url` command inside your codespace terminal and follow the URL that the command outputs. +如果没有在存储库中定义配置,{% data variables.product.prodname_dotcom %} 使用默认 Linux 映像创建 codespace。 此 Linux 映像包括许多常用语言的运行时版本,例如 Python、Node、PHP、Java、Go、C++、Ruby 和 .NET Core/C#。 使用这些语言的最新或 LTS 版本。 还有一些工具可以支持数据科学和机器学习,例如 JupyterLab 和 Conda。 该映像还包括其他开发人员工具和实用程序,例如 Git、GitHub CLI、yarn、openssh 和 vim。 若要查看包含的所有语言、运行时和工具,请在 codespace 终端中使用 `devcontainer-info content-url` 命令,并遵循命令输出的 URL。 -For information about what's included in the default Linux image, see the [`devcontainers/images`](https://github.com/devcontainers/images/tree/main/src/universal) repository. +有关默认 Linux 映像中包含内容的信息,请参阅 [`devcontainers/images`](https://github.com/devcontainers/images/tree/main/src/universal) 存储库。 -The default configuration is a good option if you're working on a small project that uses the languages and tools that {% data variables.product.prodname_github_codespaces %} provides. +如果要处理使用 {% data variables.product.prodname_github_codespaces %} 提供的语言和工具的小型项目,默认配置是个不错的选择。 -## Using a predefined dev container configuration +## 使用预定义的开发容器配置 -If you use {% data variables.product.prodname_codespaces %} in {% data variables.product.prodname_vscode %}, or in a web browser, you can create a dev container configuration for your repository by choosing from a list of predefined configurations. These configurations provide common setups for particular project types, and can help you quickly get started with a configuration that already has the appropriate container options, {% data variables.product.prodname_vscode %} settings, and {% data variables.product.prodname_vscode %} extensions that should be installed. +如果在 {% data variables.product.prodname_vscode %} 或 Web 浏览器中使用 {% data variables.product.prodname_codespaces %},可以通过从预定义配置列表中进行选择,为存储库创建开发容器配置。 这些配置提供特定项目类型的共同设置,可帮助你快速开始使用已经有适当的容器选项、{% data variables.product.prodname_vscode %} 设置和应该安装的 {% data variables.product.prodname_vscode %} 扩展的配置。 -Using a predefined configuration is a great idea if you need some additional extensibility. You can also start with a predefined configuration and amend it as needed for your project. For more information about the definitions of predefined dev containers, see the [`devcontainers/images`](https://github.com/devcontainers/images/tree/main/src) repository. +如果您需要一些额外的扩展性,使用预先定义的配置是一个好主意。 也可以从预定义的配置开始,并根据项目的需要对其进行修改。 有关预定义开发容器定义的详细信息,请参阅 [`devcontainers/images`](https://github.com/devcontainers/images/tree/main/src) 存储库。 -You can add a predefined dev container configuration either while working in a codespace, or while working on a repository locally. To do this in {% data variables.product.prodname_vscode_shortname %} while you are working locally, and not connected to a codespace, you must have the "Dev Containers" extension installed and enabled. For more information about this extension, see the [{% data variables.product.prodname_vs_marketplace_shortname %}](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers). The following procedure describes the process when you are using a codespace. The steps in {% data variables.product.prodname_vscode_shortname %} when you are not connected to a codespace are very similar. +可以在 codespace 中工作时或在本地处理存储库时添加预定义的开发容器配置。 若要在本地工作且未连接到 codespace 时在 {% data variables.product.prodname_vscode_shortname %} 中执行此操作,必须安装并启用“开发容器”扩展。 有关该扩展的详细信息,请参阅 [{% data variables.product.prodname_vs_marketplace_shortname %}](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)。 以下步骤介绍使用 codespace 的过程。 未连接到 codespace 时 {% data variables.product.prodname_vscode_shortname %} 中的步骤非常相似。 {% data reusables.codespaces.command-palette-container %} -1. Click the definition you want to use. +1. 单击要使用的定义。 - ![Screenshot of a list of predefined container definitions](/assets/images/help/codespaces/predefined-container-definitions-list.png) + ![预定义容器定义列表的屏幕截图](/assets/images/help/codespaces/predefined-container-definitions-list.png) -1. Follow the prompts to customize your definition. For more information on the options to customize your definition, see "[Adding additional features to your `devcontainer.json` file](#adding-additional-features-to-your-devcontainerjson-file)." -1. Click **OK**. +1. 按照提示自定义您的定义。 有关自定义定义的选项的详细信息,请参阅“[向 `devcontainer.json` 文件添加其他功能](#adding-additional-features-to-your-devcontainerjson-file)”。 +1. 单击" **确定**"。 - ![Screenshot of the OK button](/assets/images/help/codespaces/prebuilt-container-ok-button.png) + ![“确定”按钮的屏幕截图](/assets/images/help/codespaces/prebuilt-container-ok-button.png) -1. If you are working in a codespace, apply your changes, by clicking **Rebuild now** in the message at the bottom right of the window. For more information about rebuilding your container, see "[Applying changes to your configuration](#applying-configuration-changes-to-a-codespace)." +1. 如果在 codespace 中工作,请应用更改,方法是单击窗口右下角的消息中的“立即重新生成”。 有关重新生成容器的详细信息,请参阅“[对配置应用更改](#applying-configuration-changes-to-a-codespace)”。 - ![Screenshot of a prompt to 'Rebuild now'](/assets/images/help/codespaces/rebuild-prompt.png) + ![提示“立即重新生成”的屏幕截图](/assets/images/help/codespaces/rebuild-prompt.png) -### Adding additional features to your `devcontainer.json` file +### 向 `devcontainer.json` 文件添加其他功能 -{% data reusables.codespaces.about-features %} For more information, see "[Adding features to a `devcontainer.json` file](/codespaces/setting-up-your-project-for-codespaces/adding-features-to-a-devcontainer-file?tool=vscode)." +{% data reusables.codespaces.about-features %} 有关详细信息,请参阅“[向 `devcontainer.json` 文件添加功能](/codespaces/setting-up-your-project-for-codespaces/adding-features-to-a-devcontainer-file?tool=vscode)”。 -## Creating a custom dev container configuration +## 创建自定义开发容器配置 -If none of the predefined configurations meets your needs, you can create a custom configuration by writing your own `devcontainer.json` file. +如果任何预定义配置都不符合你的需求,可以通过编写自己的 `devcontainer.json` 文件创建自定义配置。 -* If you're adding a single `devcontainer.json` file that will be used by everyone who creates a codespace from your repository, create the file within a `.devcontainer` directory at the root of the repository. -* If you want to offer users a choice of configuration, you can create multiple custom `devcontainer.json` files, each located within a separate subdirectory of the `.devcontainer` directory. +* 如果要添加一个 `devcontainer.json` 文件,该文件将由从存储库创建 codespace 的每个人使用,请在存储库根目录的 `.devcontainer` 目录中创建该文件。 +* 如果要为用户提供配置选择,可以创建多个自定义 `devcontainer.json` 文件,每个文件位于 `.devcontainer` 目录的单独子目录中。 {% note %} - **Notes**: - - You can't locate your `devcontainer.json` files in directories more than one level below `.devcontainer`. For example, a file at `.devcontainer/teamA/devcontainer.json` will work, but `.devcontainer/teamA/testing/devcontainer.json` will not. - - {% data reusables.codespaces.configuration-choice-templates %} For more information, see "[Setting up a template repository for {% data variables.product.prodname_github_codespaces %}](/codespaces/setting-up-your-project-for-codespaces/setting-up-a-template-repository-for-github-codespaces)." + **注释**: + - 无法在比 `.devcontainer` 低一级的目录中找到 `devcontainer.json` 文件。 例如,位于 `.devcontainer/teamA/devcontainer.json` 的文件可以正常运行,但 `.devcontainer/teamA/testing/devcontainer.json` 不行。 + - {% data reusables.codespaces.configuration-choice-templates %} 有关详细信息,请参阅“[设置 {% data variables.product.prodname_github_codespaces %} 的模板存储库](/codespaces/setting-up-your-project-for-codespaces/setting-up-a-template-repository-for-github-codespaces)”。 {% endnote %} - If multiple `devcontainer.json` files are found in the repository, they are listed in the codespace creation options page. For more information, see "[Creating a codespace for a repository](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)." + 如果在存储库中找到多个 `devcontainer.json` 文件,则会在 codespace 创建选项页中列出这些文件。 有关详细信息,请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)”。 - ![Screenshot of a choice of configuration files](/assets/images/help/codespaces/configuration-file-choice.png) + ![选择配置文件的屏幕截图](/assets/images/help/codespaces/configuration-file-choice.png) -### Adding a `devcontainer.json` file +### 添加 `devcontainer.json` 文件 -If you don't already have a `devcontainer.json` file in your repository, you can quickly add one from {% data variables.product.prodname_dotcom_the_website %}. -1. Navigate to your repository and click the **{% octicon "code" aria-label="The code icon" %} Code** dropdown. -1. In the **Codespaces** tab, click the ellipsis (**...**), then select **Configure dev container**. +如果存储库中还没有 `devcontainer.json` 文件,可以从 {% data variables.product.prodname_dotcom_the_website %} 快速添加一个。 +1. 导航到存储库,然后单击“{% octicon "code" aria-label="The code icon" %} 代码”下拉列表。 +1. 在“Codespace”选项卡中,单击省略号 (...),然后选择“配置开发容器” 。 - ![Screenshot of the Code dropdown, with "Configure dev container" highlighted](/assets/images/help/codespaces/configure-dev-container.png) + ![“代码”下拉列表的屏幕截图,其中突出显示了“配置开发容器”](/assets/images/help/codespaces/configure-dev-container.png) -A new `.devcontainer/devcontainer.json` file will open in the editor. The file will contain some initial properties, including a `features` object to which you can add new tools, libraries, or runtimes. For more information, see "[Adding features to a `devcontainer.json` file](/codespaces/setting-up-your-project-for-codespaces/adding-features-to-a-devcontainer-file?tool=webui)." +编辑器中将打开一个新的 `.devcontainer/devcontainer.json` 文件。 该文件将包含一些初始属性,包括可以向其添加新工具、库或运行时的 `features` 对象。 有关详细信息,请参阅“[向 `devcontainer.json` 文件添加功能](/codespaces/setting-up-your-project-for-codespaces/adding-features-to-a-devcontainer-file?tool=webui)”。 -If your repository already contains one or more `devcontainer.json` files, then clicking **Configure dev container** will open the existing `devcontainer.json` file with the highest precedence according to the [specification](https://containers.dev/implementors/spec/#devcontainerjson) on containers.dev. +如果存储库已包含一个或多个 `devcontainer.json` 文件,则单击“配置开发容器”,会根据 containers.dev 上的[规范](https://containers.dev/implementors/spec/#devcontainerjson)以最高优先级打开现有 `devcontainer.json` 文件。 -### Default configuration selection during codespace creation +### 创建 codespace 期间的默认配置选择 -If `.devcontainer/devcontainer.json` or `.devcontainer.json` exists, it will be the default selection in the list of available configuration files when you create a codespace. If neither file exists, the default dev container configuration will be selected by default. +如果 `.devcontainer/devcontainer.json` 或 `.devcontainer.json` 存在,则创建 codespace 时,它将是可用配置文件列表中的默认选择。 如果两个文件都不存在,则默认选择默认开发容器配置。 -![Screenshot of the default configuration choice selected](/assets/images/help/codespaces/configuration-file-choice-default.png) +![所选默认配置选项的屏幕截图](/assets/images/help/codespaces/configuration-file-choice-default.png) -### Editing the devcontainer.json file +### 编辑 devcontainer.json 文件 -You can add and edit the supported configuration keys in the `devcontainer.json` file to specify aspects of the codespace's environment, like which {% data variables.product.prodname_vscode_shortname %} extensions will be installed. {% data reusables.codespaces.more-info-devcontainer %} +可以在 `devcontainer.json` 文件中添加和编辑支持的配置键,以指定 codespace 环境的各个方面,例如将安装哪些 {% data variables.product.prodname_vscode_shortname %} 扩展。 {% data reusables.codespaces.more-info-devcontainer %} -The `devcontainer.json` file is written using the JSONC (JSON with comments) format. This allows you to include comments within the configuration file. For more information, see "[Editing JSON with {% data variables.product.prodname_vscode_shortname %}](https://code.visualstudio.com/docs/languages/json#_json-with-comments)" in the {% data variables.product.prodname_vscode_shortname %} documentation. +`devcontainer.json` 文件是使用 JSONC(带注释的 JSON)格式编写的。 这样,就可以在配置文件中包含注释。 有关详细信息,请参阅 {% data variables.product.prodname_vscode_shortname %} 文档中的“[使用 {% data variables.product.prodname_vscode_shortname %} 编辑 JSON](https://code.visualstudio.com/docs/languages/json#_json-with-comments)”。 {% note %} -**Note**: If you use a linter to validate the `devcontainer.json` file, make sure it is set to JSONC and not JSON or comments will be reported as errors. +注意:如果使用 Linter 验证 `devcontainer.json` 文件,请确保将其设置为 JSONC 而不是 JSON,否则注释将被报告为错误。 {% endnote %} -### Interface settings for {% data variables.product.prodname_vscode_shortname %} +### {% data variables.product.prodname_vscode_shortname %} 的接口设置 -You can configure the interface settings for {% data variables.product.prodname_vscode_shortname %}, with three scopes: Workspace, Remote [Codespaces], and User. You can view these scopes in the {% data variables.product.prodname_vscode_shortname %} Settings editor. +可以使用以下三个范围为 {% data variables.product.prodname_vscode_shortname %} 配置接口设置:工作区、远程 [Codespaces] 和用户。 可以在 {% data variables.product.prodname_vscode_shortname %}“设置”编辑器中查看这些范围。 -![Screenshot showing the choice of scopes in the Settings editor](/assets/images/help/codespaces/scopes-for-vscode.png) +![显示“设置”编辑器中范围选择的屏幕截图](/assets/images/help/codespaces/scopes-for-vscode.png) -If a setting is defined in multiple scopes, Workspace settings take priority, then Remote [Codespaces], then User. +如果某个设置在多个范围内定义,则优先顺序依次为“工作区”设置、“远程 [Codespaces]”、“用户” 。 -You can define default interface settings for {% data variables.product.prodname_vscode_shortname %} in two places. +可以在两个地方定义 {% data variables.product.prodname_vscode_shortname %} 的默认接口设置。 -* Interface settings defined in the `.vscode/settings.json` file in your repository are applied as Workspace-scoped settings in the codespace. -* Interface settings defined in the `settings` key in the `devcontainer.json` file are applied as Remote [Codespaces]-scoped settings in the codespace. +* 在存储库的 `.vscode/settings.json` 文件中定义的接口设置在 codespace 中应用为工作区范围的设置。 +* 在 `devcontainer.json` 文件的 `settings` 键中定义的接口设置应用为 codespace 中远程 [Codespaces] 范围的设置。 -## Applying configuration changes to a codespace +## 将配置更改应用于 codespace -Changes to a configuration will be applied the next time you create a codespace. However, if you're using a codespace in a web browser, in {% data variables.product.prodname_vscode_shortname %}, or in a JetBrains IDE, you can apply configuration changes to the current codespace by rebuilding the container. +对配置的更改将在下次创建 codespace 时应用。 但是,如果在 Web 浏览器、{% data variables.product.prodname_vscode_shortname %} 或 JetBrains IDE 中使用 codespace,则可以通过重新生成容器将配置更改应用于当前 codespace。 -### Rebuilding the dev container in the {% data variables.product.prodname_vscode_shortname %} web client or desktop application +### 在 {% data variables.product.prodname_vscode_shortname %} Web 客户端或桌面应用程序中重新生成开发容器 {% data reusables.codespaces.rebuild-command %} 1. {% data reusables.codespaces.recovery-mode %} - ![Screenshot of the error message about recovery mode](/assets/images/help/codespaces/recovery-mode-error-message.png) + ![有关恢复模式错误消息的屏幕截图](/assets/images/help/codespaces/recovery-mode-error-message.png) - - To diagnose the error by reviewing the creation logs, click **View creation log**. - - To fix the errors identified in the logs, update your `devcontainer.json` file. - - To apply the changes, rebuild your container. + - 若要通过查看创建日志来诊断错误,请单击“查看创建日志”。 + - 若要修复日志中标识的错误,请更新 `devcontainer.json` 文件。 + - 要应用更改,请重建容器。 -### Rebuilding the dev container in a JetBrains IDE +### 在 JetBrains IDE 中重新生成开发容器 {% data reusables.codespaces.jetbrains-open-codespace-plugin %} -1. In the {% data variables.product.prodname_github_codespaces %} tool window, click the rebuild icon. +1. 在 {% data variables.product.prodname_github_codespaces %} 工具窗口中,单击“重新生成”图标。 - ![Screenshot of the rebuild button](/assets/images/help/codespaces/jetbrains-plugin-icon-rebuild.png) + ![“重新生成”按钮的屏幕截图](/assets/images/help/codespaces/jetbrains-plugin-icon-rebuild.png) -1. Click **Rebuild** when prompted to confirm that you want to rebuild the dev container. -1. Reopen the codespace in your JetBrains IDE. +1. 当提示确认是否要重新生成开发容器时,单击“重新生成”。 +1. 在 JetBrains IDE 中重新打开 codespace。 -## Further reading +## 延伸阅读 -- "[Prebuilding your codespaces](/codespaces/prebuilding-your-codespaces)" +- [预构建 codespaces](/codespaces/prebuilding-your-codespaces) diff --git a/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-a-minimum-specification-for-codespace-machines.md b/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-a-minimum-specification-for-codespace-machines.md index e5659b2dc7..f9a6c1bbc2 100644 --- a/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-a-minimum-specification-for-codespace-machines.md +++ b/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-a-minimum-specification-for-codespace-machines.md @@ -1,7 +1,7 @@ --- -title: Setting a minimum specification for codespace machines +title: 为代码空间计算机设置最低规范 shortTitle: Set a minimum machine spec -intro: 'You can avoid under-resourced machine types being used for {% data variables.product.prodname_github_codespaces %} for your repository.' +intro: '你可以避免资源不足的计算机类型用于存储库的 {% data variables.product.prodname_github_codespaces %}。' permissions: People with write permissions to a repository can create or edit the codespace configuration. versions: fpt: '*' @@ -10,26 +10,31 @@ type: how_to topics: - Codespaces - Set up +ms.openlocfilehash: b7eeaac84721ff1d9ceab663957b1615952b0623 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159163' --- +## 概述 -## Overview +创建的每个 codespace 都托管在单独的虚拟机上。 从存储库创建 codespace 时,通常可以从不同类型的虚拟机中进行选择。 每个计算机类型都有不同的资源(处理器内核、内存、存储),默认情况下,使用资源最少的计算机类型。 有关详细信息,请参阅“[更改 codespace 的计算机类型](/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace#about-machine-types)”。 -Each codespace that you create is hosted on a separate virtual machine. When you create a codespace from a repository, you can usually choose from different types of virtual machines. Each machine type has different resources (processor cores, memory, storage) and, by default, the machine type with the least resources is used. For more information, see "[Changing the machine type for your codespace](/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace#about-machine-types)." - -If your project needs a certain level of compute power, you can configure {% data variables.product.prodname_github_codespaces %} so that only machine types that meet these requirements can be used by default, or selected by users. You configure this in a `devcontainer.json` file. +如果项目需要一定程度的计算能力,则可以配置 {% data variables.product.prodname_github_codespaces %} 以便默认情况下只能使用或由用户选择满足这些要求的计算机类型。 可以在 `devcontainer.json` 文件中进行此配置。 {% data reusables.codespaces.machine-types-for-unpublished-codespaces %} {% note %} -**Important:** Access to some machine types may be restricted at the organization level. Typically this is done to prevent people choosing higher resourced machines that are billed at a higher rate. If your repository is affected by an organization-level policy for machine types you should make sure you don't set a minimum specification that would leave no available machine types for people to choose. For more information, see "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)." +重要提示:对某些计算机类型的访问可能在组织级别受到限制。 通常,这样做是为了防止人们选择以较高费率计费的资源较高的计算机。 如果您的存储库受到组织级计算机类型策略的影响,则应确保不要设置最低规范,因为该规范不会留下任何可用的计算机类型供人们选择。 有关详细信息,请参阅“[限制对计算机类型的访问](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)”。 {% endnote %} -## Setting a minimum machine specification +## 设置最低计算机规范 {% data reusables.codespaces.edit-devcontainer-json %} -1. Edit the `devcontainer.json` file, adding the `hostRequirements` property at the top level of the file, within the enclosing JSON object. For example: +1. 编辑 `devcontainer.json` 文件,将属性 `hostRequirements` 添加到文件顶层,位于封闭的 JSON 对象内。 例如: ```json{:copy} "hostRequirements": { @@ -39,16 +44,16 @@ If your project needs a certain level of compute power, you can configure {% dat } ``` - You can specify any or all of the options: `cpus`, `memory`, and `storage`. + 可以指定以下任何或所有选项:`cpus`、`memory` 和 `storage`。 - To check the specifications of the {% data variables.product.prodname_github_codespaces %} machine types that are currently available for your repository, step through the process of creating a codespace until you see the choice of machine types. For more information, see "[Creating a codespace for a repository](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)." + 要检查当前可用于存储库的 {% data variables.product.prodname_github_codespaces %} 计算机类型的规范,请逐步完成创建 codespace 的过程,直到看到选择的计算机类型。 有关详细信息,请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)”。 -1. Save the file and commit your changes to the required branch of the repository. +1. 保存文件并将更改提交到存储库的所需分支。 - Now when you create a codespace for that branch of the repository, and you go to the creation configuration options, you will only be able to select machine types that match or exceed the resources you've specified. + 现在,当你为存储库的该分支创建代码空间时,前往创建配置选项,只能选择与指定资源匹配或超过你指定的资源的计算机类型。 - ![Dialog box showing a limited choice of machine types](/assets/images/help/codespaces/machine-types-limited-choice.png) + ![显示有限计算机类型选择的对话框](/assets/images/help/codespaces/machine-types-limited-choice.png) -## Further reading +## 延伸阅读 -- "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)" +- “[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)” diff --git a/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-a-template-repository-for-github-codespaces.md b/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-a-template-repository-for-github-codespaces.md new file mode 100644 index 0000000000..61e3ede4d7 --- /dev/null +++ b/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-a-template-repository-for-github-codespaces.md @@ -0,0 +1,88 @@ +--- +title: 为 GitHub Codespaces 设置模板存储库 +shortTitle: Set up a template repo +intro: '可以通过为 {% data variables.product.prodname_github_codespaces %} 设置模板存储库,帮助用户开始使用项目。' +versions: + fpt: '*' + ghec: '*' +type: how_to +topics: + - Codespaces + - Set up +ms.openlocfilehash: 155aa9bf839301439d2746b4b6f0f0575d2e60ff +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159438' +--- +## 简介 + +通过设置模板存储库,可以帮助用户开始使用你的框架、库或 {% data variables.product.prodname_github_codespaces %} 中的其他项目。 用户将能够立即在基于云的开发环境中开始使用模板文件,而无需担心克隆存储库或安装工具或其他依赖项。 通过某些配置,你能够在 codespace 中设置用户,其中重要文件已打开以供编辑,并且应用程序已在 {% data variables.product.prodname_vscode_shortname %} Web 编辑器中的预览浏览器选项卡中运行。 + +具有模板存储库读取访问权限的任何人都可以从 {% data variables.product.product_name %} 上的存储库页面创建 codespace。 可以将任何现有存储库转换为模板,无需更改任何设置即可支持用户从模板存储库创建 codespace。 有关将存储库转换为模板的详细信息,请参阅“[创建模板存储库](/repositories/creating-and-managing-repositories/creating-a-template-repository)”。 + +可以提供格式为 `https://github.com/codespaces/new?template_repository=OWNER/TEMPLATE-REPO` 的链接,使用户直接转到模板的“创建新 codespace”页面。 + +![“创建新 codespace”页的屏幕截图](/assets/images/help/codespaces/create-a-new-codespace-page.png) + +例如,可以在关于开始使用你的框架的教程中提供此链接。 在链接中,将 `OWNER/TEMPLATE-REPO` 替换为模板存储库的名称,例如 `monalisa/octo-template`。 + +当某人从你的模板创建 codespace 时,你的模板存储库的内容将克隆到其 codespace 中。 用户准备就绪后,他们可以将工作发布到属于其个人帐户的 {% data variables.product.product_name %} 上的新存储库。 codespace 的任何使用费都将由创建 codespace 的用户支付。 有关详细信息,请参阅“[从模板创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template)”。 + +## 描述模板 + +如果没有模板,请为模板存储库创建自述文件,以描述模板的用途以及如何开始使用它。 有关详细信息,请参阅“[关于 README](/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes)”。 + +模板的简短描述会显示在用户通过 `https://github.com/codespaces/new?template_repository=OWNER/TEMPLATE-REPO` 链接登陆的“创建新 codespace”页面上。 此说明来自创建存储库时可以设置的“说明”字段。 可以随时编辑此说明,方法是导航到存储库的页面,然后单击页面右侧“关于”部分旁边的“{% octicon "gear" aria-label="The Settings gear" %}”。 + +![存储库页上“关于”部分的屏幕截图](/assets/images/help/repository/repository-settings-icon.png) + +## 添加初学者文件 + +模板存储库通常包含具有样板代码的初学者文件,以便用户可以快速开始使用库、框架或其他技术。 + +有关要包含的文件类型的指导,可以查看 {% data variables.product.prodname_github_codespaces %} 的官方 {% data variables.product.company_short %} 模板中包含的初学者文件,如下所示。 + +{% data reusables.codespaces.your-codespaces-procedure-step %} {% data reusables.codespaces.view-all-templates-step %} +1. 若要查看包含模板文件的模板存储库,请单击模板的名称。 + + ![“探索快速入门模板”部分的屏幕截图,其中突出显示了“React”](/assets/images/help/codespaces/react-template-name.png) + +## 配置容器映像 + +可以将开发容器配置文件添加到模板存储库,以便为将模板用于 {% data variables.product.prodname_github_codespaces %} 的用户自定义开发环境。 可以从 {% data variables.product.prodname_vscode %} 中的预定义配置设置列表中进行选择,也可以通过编写自己的 `devcontainer.json` 文件创建自定义配置。 如果不添加配置文件,将使用默认容器映像。 有关详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)”和“[将开发容器配置添加到存储库](/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces)”。 + +{% note %} + +注意:{% data reusables.codespaces.configuration-choice-templates %} + +{% endnote %} + +应使用工具和自定义项配置开发容器,为用户提供模板的最佳体验。 例如,在 `devcontainer.json` 文件中: +- 从模板创建 codespace 时,可以使用 `openFiles` 属性,定义要在 {% data variables.product.prodname_vscode_shortname %} Web 客户端中自动打开的文件列表。 +- 如果模板包含 Web 应用程序的文件,则可以使应用程序在用户的 codespace 中自动运行。 为此,可以使用 `postAttachCommand` 属性运行脚本,该脚本在 {% data variables.product.prodname_vscode_shortname %} Web 客户端连接到 codespace 后立即在本地服务器上启动应用程序,并将端口的 `onAutoForward` 属性设置为 `openPreview`,以便在嵌入 {% data variables.product.prodname_vscode_shortname %} Web 客户端的简单浏览器中显示在该端口上运行的应用程序。 + +React 模板的以下配置设置将在用户的编辑器中打开 `app.js` 文件,运行(在 `package.json` 文件中定义的)`npm start` 来启动本地服务器,并将端口 `3000` 转发到 codespace 中的预览浏览器选项卡。 + +```JSON +{ + "postAttachCommand": { + "server": "npm start", + }, + + "portsAttributes": { + "3000": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, + + "customizations": { + "codespaces": { + "openFiles": ["src/App.js"] + } + } +} +``` +有关详细信息,请参阅“[在存储库的 codespaces 中自动打开文件](/codespaces/setting-up-your-project-for-codespaces/automatically-opening-files-in-the-codespaces-for-a-repository)”和 containers.dev [上的开发容器规范](https://containers.dev/implementors/json_reference/#general-properties)。 diff --git a/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-dotnet-project-for-codespaces.md b/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-dotnet-project-for-codespaces.md index 43cbbf8871..8b96c481aa 100644 --- a/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-dotnet-project-for-codespaces.md +++ b/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-dotnet-project-for-codespaces.md @@ -1,8 +1,8 @@ --- -title: Setting up your C# (.NET) project for GitHub Codespaces +title: 为 GitHub Codespaces 设置 C# (.NET) 项目 shortTitle: Setting up your C# (.NET) project allowTitleToDifferFromFilename: true -intro: 'Get started with your C# (.NET) project in {% data variables.product.prodname_github_codespaces %} by creating a custom dev container.' +intro: '通过创建自定义开发容器,开始在 {% data variables.product.prodname_github_codespaces %} 中使用 C# (.NET) 项目。' redirect_from: - /codespaces/getting-started-with-codespaces/getting-started-with-your-dotnet-project versions: @@ -12,122 +12,126 @@ topics: - Codespaces hasExperimentalAlternative: true hidden: true +ms.openlocfilehash: 10282aedf3bdb239fa238e546c2fc6280787a6a0 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158611' --- +## 简介 -## Introduction +本指南介绍如何设置 C# (.NET) 项目 {% data reusables.codespaces.setting-up-project-intro %} -This guide shows you how to set up your C# (.NET) project {% data reusables.codespaces.setting-up-project-intro %} +### 先决条件 -### Prerequisites +- 您应该在 {% data variables.product.prodname_dotcom_the_website %} 的仓库中有现有的 C# (.NET) 项目。 如果没有项目,可以使用以下示例尝试本教程: https://github.com/2percentsilk/dotnet-quickstart 。 +- 必须为组织启用 {% data variables.product.prodname_github_codespaces %}。 -- You should have an existing C# (.NET) project in a repository on {% data variables.product.prodname_dotcom_the_website %}. If you don't have a project, you can try this tutorial with the following example: https://github.com/2percentsilk/dotnet-quickstart. -- You must have {% data variables.product.prodname_github_codespaces %} enabled for your organization. +## 步骤 1:在代码空间中打开项目 -## Step 1: Open your project in a codespace +1. 在存储库名称下,使用“{% octicon "code" aria-label="The code icon" %} 代码”下拉菜单,然后在“Codespaces”选项卡中,单击加号 ({% octicon "plus" aria-label="The plus icon" %}) 。 -1. Under the repository name, use the **{% octicon "code" aria-label="The code icon" %} Code** dropdown menu, and in the **Codespaces** tab, click the plus sign ({% octicon "plus" aria-label="The plus icon" %}). + ![新建代码空间按钮](/assets/images/help/codespaces/new-codespace-button.png) - ![New codespace button](/assets/images/help/codespaces/new-codespace-button.png) - -When you create a codespace, your project is created on a remote VM that is dedicated to you. By default, the container for your codespace has many languages and runtimes including .NET. It also includes a common set of tools like git, wget, rsync, openssh, and nano. +创建代码空间时,您的项目是在专用于您的远程 VM 上创建的。 默认情况下,代码空间的容器具有多种语言和运行时,包括 .NET。 它还包括一套常见的工具,例如 git、wget、rsync、openssh 和 nano。 {% data reusables.codespaces.customize-vcpus-and-ram %} -## Step 2: Add a dev container configuration to your repository from a template +## 步骤 2:从模板将开发容器配置添加到存储库 -The default development container, or "dev container," for {% data variables.product.prodname_github_codespaces %} comes with the latest .NET version and common tools preinstalled. However, we recommend that you configure your own dev container to include all of the tools and scripts that your project needs. This will ensure a fully reproducible environment for all {% data variables.product.prodname_github_codespaces %} users in your repository. +{% data variables.product.prodname_github_codespaces %} 的默认开发容器或“开发容器”预先安装了最新的 .NET 版本和常用工具。 但是,我们建议配置自己的开发容器,以包含项目所需的所有工具和脚本。 这将确保存储库中的所有 {% data variables.product.prodname_github_codespaces %} 用户都拥有完全可复制的环境。 {% data reusables.codespaces.setup-custom-devcontainer %} {% data reusables.codespaces.command-palette-container %} -1. For this example, click **C# (.NET)**. If you need additional features you can select any container that’s specific to C# (.NET) or a combination of tools such as C# (.NET) and MS SQL. - ![Select C# (.NET) option from the list](/assets/images/help/codespaces/add-dotnet-prebuilt-container.png) -1. Click the recommended version of .NET. - ![.NET version selection](/assets/images/help/codespaces/add-dotnet-version.png) -1. Accept the default option to add Node.js to your customization. - ![Add Node.js selection](/assets/images/help/codespaces/dotnet-options.png) -{% data reusables.codespaces.rebuild-command %} +1. 在本示例中,请单击“C# (.NET)”。 如果需要其他功能,您可以选择任何特定于 C# (.NET) 或工具(如 C# (.NET) 和 MS SQL)组合的容器。 + ![从列表中选择 C# (.NET) 选项](/assets/images/help/codespaces/add-dotnet-prebuilt-container.png) +1. 单击推荐的 .NET 版本。 + ![.NET 版本选择](/assets/images/help/codespaces/add-dotnet-version.png) +1. 接受默认选项,将 Node.js 添加到您的自定义中。 + ![添加 Node.js 选择](/assets/images/help/codespaces/dotnet-options.png) {% data reusables.codespaces.rebuild-command %} -### Anatomy of your dev container +### 开发容器的剖析 -Adding the C# (.NET) dev container template adds a `.devcontainer` folder to the root of your project's repository with the following files: +添加 C# (.NET) 开发容器模板会将 `.devcontainer` 文件夹添加到项目存储库的根目录中,其中包含以下文件: - `devcontainer.json` - Dockerfile -The newly added `devcontainer.json` file defines a few properties that are described after the sample. +新添加的 `devcontainer.json` 文件定义了在示例之后描述的几个属性。 #### devcontainer.json ```json { - "name": "C# (.NET)", - "build": { - "dockerfile": "Dockerfile", - "args": { - // Update 'VARIANT' to pick a .NET Core version: 2.1, 3.1, 5.0 - "VARIANT": "5.0", - // Options - "INSTALL_NODE": "true", - "NODE_VERSION": "lts/*", - "INSTALL_AZURE_CLI": "false" - } - }, + "name": "C# (.NET)", + "build": { + "dockerfile": "Dockerfile", + "args": { + // Update 'VARIANT' to pick a .NET Core version: 2.1, 3.1, 5.0 + "VARIANT": "5.0", + // Options + "INSTALL_NODE": "true", + "NODE_VERSION": "lts/*", + "INSTALL_AZURE_CLI": "false" + } + }, - // Set *default* container specific settings.json values on container create. - "settings": { - "terminal.integrated.shell.linux": "/bin/bash" - }, + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.shell.linux": "/bin/bash" + }, - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "ms-dotnettools.csharp" - ], + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-dotnettools.csharp" + ], - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [5000, 5001], + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [5000, 5001], - // [Optional] To reuse of your local HTTPS dev cert: - // - // 1. Export it locally using this command: - // * Windows PowerShell: - // dotnet dev-certs https --trust; dotnet dev-certs https -ep "$env:USERPROFILE/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere" - // * macOS/Linux terminal: - // dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere" - // - // 2. Uncomment these 'remoteEnv' lines: - // "remoteEnv": { - // "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere", - // "ASPNETCORE_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/aspnetapp.pfx", - // }, - // - // 3. Start the container. - // - // 4. Drag ~/.aspnet/https/aspnetapp.pfx into the root of the file explorer. - // - // 5. Open a terminal in VS Code and run "mkdir -p /home/vscode/.aspnet/https && mv aspnetapp.pfx /home/vscode/.aspnet/https". - // + // [Optional] To reuse of your local HTTPS dev cert: + // + // 1. Export it locally using this command: + // * Windows PowerShell: + // dotnet dev-certs https --trust; dotnet dev-certs https -ep "$env:USERPROFILE/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere" + // * macOS/Linux terminal: + // dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere" + // + // 2. Uncomment these 'remoteEnv' lines: + // "remoteEnv": { + // "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere", + // "ASPNETCORE_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/aspnetapp.pfx", + // }, + // + // 3. Start the container. + // + // 4. Drag ~/.aspnet/https/aspnetapp.pfx into the root of the file explorer. + // + // 5. Open a terminal in VS Code and run "mkdir -p /home/vscode/.aspnet/https && mv aspnetapp.pfx /home/vscode/.aspnet/https". + // - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "dotnet restore", + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "dotnet restore", - // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode" + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode" } ``` -- **name** - You can name our dev container anything, this is just the default. -- **build** - The build properties. - - **dockerfile** - In the `build` object, `dockerfile` contains the path to the Dockerfile that was also added from the template. +- name - 可以将开发容器命名为任何名称,这只是默认名称。 +- build - 生成属性。 + - dockerfile - 在 `build` 对象中,`dockerfile` 包含 Dockerfile 的路径,该文件也是从模板中添加的。 - **args** - - **variant**: This file only contains one build argument, which is the .NET Core version that we want to use. -- **settings** - These are {% data variables.product.prodname_vscode %} settings. - - **terminal.integrated.shell.linux** - While bash is the default here, you could use other terminal shells by modifying this. -- **extensions** - These are extensions included by default. - - **ms-dotnettools.csharp** - The Microsoft C# extension provides rich support for developing in C#, including features such as IntelliSense, linting, debugging, code navigation, code formatting, refactoring, variable explorer, test explorer, and more. -- **forwardPorts** - Any ports listed here will be forwarded automatically. For more information, see "[Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)." -- **postCreateCommand** - Use this to run commands that aren't defined in the Dockerfile, after your codespace is created. -- **remoteUser** - By default, you’re running as the vscode user, but you can optionally set this to root. + - variant:此文件仅包含一个生成参数,即我们要使用的 .NET Core 版本。 +- settings - 这些是 {% data variables.product.prodname_vscode %} 设置。 + - terminal.integrated.shell.linux - 虽然 bash 是此处的默认设置,但你可以通过修改它来使用其他终端 shell。 +- extensions - 这些是默认包含的扩展。 + - **ms-dotnettools.csharp** - Microsoft C# 扩展为使用 C# 的开发提供丰富的支持,包括 IntelliSense、linting、调试、代码导航、代码格式化、重构、变量资源管理器、测试资源管理器等功能。 +- **forwardPorts** - 此处列出的任何端口都将自动转发。 有关详细信息,请参阅“[在 codespace 中转发端口](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)。” +- postCreateCommand - 使用此方法在创建 codespace 后,运行未在 Dockerfile 中定义的命令。 +- **remoteUser** - 默认情况下以 vscode 用户身份运行,但可以选择将其设置为 root。 #### Dockerfile @@ -155,26 +159,26 @@ RUN if [ "$INSTALL_AZURE_CLI" = "true" ]; then bash /tmp/library-scripts/azcli-d # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 ``` -You can use the Dockerfile to add additional container layers to specify OS packages, node versions, or global packages we want included in our container. +您可以使用 Dockerfile 添加其他容器层,以指定要包含在容器中的操作系统包、节点版本或全局包。 -## Step 3: Modify your devcontainer.json file +## 步骤 3:修改 devcontainer.json 文件 -With your dev container configuration added and a basic understanding of what everything does, you can now make changes to customize your environment further. In this example, you'll add properties to install extensions and your project dependencies when your codespace launches. +添加了开发容器配置并基本了解所有功能之后,现在可以进行更改以进一步自定义你的环境。 在此示例中,您将在代码空间启动时添加属性以安装扩展和项目依赖项。 -1. In the Explorer, select the `devcontainer.json` file from the tree to open it. You might have to expand the `.devcontainer` folder to see it. +1. 在资源管理器中,从树中选择 `devcontainer.json` 文件以将其打开。 可能需要展开 `.devcontainer` 文件夹才能看到它。 - ![devcontainer.json file in the Explorer](/assets/images/help/codespaces/devcontainers-options.png) + ![Explorer 中的 devcontainer.json 文件](/assets/images/help/codespaces/devcontainers-options.png) -2. Update your the `extensions` list in your `devcontainer.json` file to add a few extensions that are useful when working with your project. +2. 更新 `devcontainer.json` 文件中的 `extensions` 列表,以添加一些在处理项目时有用的扩展。 ```json{:copy} "extensions": [ - "ms-dotnettools.csharp", - "streetsidesoftware.code-spell-checker", - ], + "ms-dotnettools.csharp", + "streetsidesoftware.code-spell-checker", + ], ``` -3. Uncomment the `postCreateCommand` to restore dependencies as part of the codespace setup process. +3. 取消注释 `postCreateCommand` 以便在 codespace 设置过程中恢复依赖项。 ```json{:copy} // Use 'postCreateCommand' to run commands after the container is created. @@ -187,26 +191,26 @@ With your dev container configuration added and a basic understanding of what ev {% data reusables.codespaces.rebuild-reason %} -5. Check your changes were successfully applied by verifying the "Code Spell Checker" extension was installed. +5. 通过验证是否安装了 "Code Spell Checker" 扩展,检查更改是否成功应用。 - ![Extensions list](/assets/images/help/codespaces/dotnet-extensions.png) + ![扩展列表](/assets/images/help/codespaces/dotnet-extensions.png) -## Step 4: Run your application +## 步骤 4:运行应用程序 -In the previous section, you used the `postCreateCommand` to install a set of packages via the `dotnet restore` command. With our dependencies now installed, we can run our application. +在上一部分中,你使用 `postCreateCommand` 通过 `dotnet restore` 命令安装了一组包。 现在安装了依赖项,我们可以运行应用程序。 -1. Run your application by pressing `F5` or entering `dotnet watch run` in your terminal. +1. 通过按 `F5` 或在终端中输入 `dotnet watch run` 来运行应用程序。 -2. When your project starts, you should see a "toast" notification message at the bottom right corner of {% data variables.product.prodname_vscode_shortname %}, containing a prompt to connect to the port your project uses. +2. 项目启动时,{% data variables.product.prodname_vscode_shortname %} 右下角应会显示一条“toast”通知消息,其中包含连接到项目使用的端口的提示。 - ![Port forwarding "toast" notification](/assets/images/help/codespaces/python-port-forwarding.png) + ![端口转发“toast”通知](/assets/images/help/codespaces/python-port-forwarding.png) -## Step 5: Commit your changes +## 步骤 5:提交更改 {% data reusables.codespaces.committing-link-to-procedure %} -## Next steps +## 后续步骤 -You should now be ready start developing your C# (.NET) project in {% data variables.product.prodname_github_codespaces %}. Here are some additional resources for more advanced scenarios. +现在,应已准备好开始在 {% data variables.product.prodname_github_codespaces %} 中开发 C# (.NET) 项目。 以下是用于更高级场景的一些额外资源。 {% data reusables.codespaces.next-steps-adding-devcontainer %} diff --git a/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-java-project-for-codespaces.md b/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-java-project-for-codespaces.md index 954d74025b..e2e09c86aa 100644 --- a/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-java-project-for-codespaces.md +++ b/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-java-project-for-codespaces.md @@ -1,8 +1,8 @@ --- -title: Setting up your Java project for GitHub Codespaces +title: 为 GitHub Codespaces 设置 Java 项目 allowTitleToDifferFromFilename: true shortTitle: Setting up with your Java project -intro: 'Get started with your Java project in {% data variables.product.prodname_github_codespaces %} by creating a custom dev container.' +intro: '通过创建自定义开发容器,在 {% data variables.product.prodname_github_codespaces %} 中开始使用 Java 项目。' redirect_from: - /codespaces/getting-started-with-codespaces/getting-started-with-your-java-project-in-codespaces versions: @@ -12,48 +12,52 @@ topics: - Codespaces hasExperimentalAlternative: true hidden: true +ms.openlocfilehash: b861744483f61bc01e8069188c1ce6298411d57e +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158763' --- +## 简介 -## Introduction +本指南介绍如何设置 Java 项目 {% data reusables.codespaces.setting-up-project-intro %} -This guide shows you how to set up your Java project {% data reusables.codespaces.setting-up-project-intro %} +### 先决条件 -### Prerequisites +- 您应该在 {% data variables.product.prodname_dotcom_the_website %} 的仓库中有现有的 Java 项目。 如果没有项目,可以使用以下示例尝试本教程: https://github.com/microsoft/vscode-remote-try-java +- 必须为组织启用 {% data variables.product.prodname_github_codespaces %}。 -- You should have an existing Java project in a repository on {% data variables.product.prodname_dotcom_the_website %}. If you don't have a project, you can try this tutorial with the following example: https://github.com/microsoft/vscode-remote-try-java -- You must have {% data variables.product.prodname_github_codespaces %} enabled for your organization. +## 步骤 1:在代码空间中打开项目 -## Step 1: Open your project in a codespace +1. 在存储库名称下,使用“{% octicon "code" aria-label="The code icon" %} 代码”下拉菜单,然后在“Codespaces”选项卡中,单击加号 ({% octicon "plus" aria-label="The plus icon" %}) 。 -1. Under the repository name, use the **{% octicon "code" aria-label="The code icon" %} Code** dropdown menu, and in the **Codespaces** tab, click the plus sign ({% octicon "plus" aria-label="The plus icon" %}). + ![新建代码空间按钮](/assets/images/help/codespaces/new-codespace-button.png) - ![New codespace button](/assets/images/help/codespaces/new-codespace-button.png) - -When you create a codespace, your project is created on a remote VM that is dedicated to you. By default, the container for your codespace has many languages and runtimes including Java, nvm, npm, and Yarn. It also includes a set of commonly used tools such as git, wget, rsync, openssh, and nano. +创建代码空间时,您的项目是在专用于您的远程 VM 上创建的。 默认情况下,代码空间的容器有许多语言和运行时,包括 Java、nvm、npm 和 Yarn。 它还包括一套常见的工具,例如 git、wget、rsync、openssh 和 nano。 {% data reusables.codespaces.customize-vcpus-and-ram %} -## Step 2: Add a dev container configuration to your repository from a template +## 步骤 2:从模板将开发容器配置添加到存储库 -The default development container, or "dev container," for {% data variables.product.prodname_github_codespaces %} comes with the latest Java version, package managers (Maven, Gradle), and other common tools preinstalled. However, we recommend that you configure your own dev container to include all of the tools and scripts that your project needs. This will ensure a fully reproducible environment for all {% data variables.product.prodname_github_codespaces %} users in your repository. +{% data variables.product.prodname_github_codespaces %} 的默认开发容器或“开发容器”预先安装了最新的 Java 版本、包管理器(Maven、Gradle)和其他常用工具。 但是,我们建议配置自己的开发容器,以包含项目所需的所有工具和脚本。 这将确保存储库中的所有 {% data variables.product.prodname_github_codespaces %} 用户都拥有完全可复制的环境。 {% data reusables.codespaces.setup-custom-devcontainer %} {% data reusables.codespaces.command-palette-container %} -1. For this example, click **Java**. In practice, you could select any container that’s specific to Java or a combination of tools such as Java and Azure Functions. - ![Select Java option from the list](/assets/images/help/codespaces/add-java-prebuilt-container.png) -1. Click the recommended version of Java. - ![Java version selection](/assets/images/help/codespaces/add-java-version.png) -{% data reusables.codespaces.rebuild-command %} +1. 对于本示例,请单击“Java”。 实际上,您可以选择任何特定于 Java 的容器或 Java 和 Azure 函数等工具的组合。 + ![从列表中选择 Java 选项](/assets/images/help/codespaces/add-java-prebuilt-container.png) +1. 单击推荐的 Java 版本。 + ![Java 版本选择](/assets/images/help/codespaces/add-java-version.png) {% data reusables.codespaces.rebuild-command %} -### Anatomy of your dev container +### 开发容器的剖析 -Adding the Java dev container template adds a `.devcontainer` directory to the root of your project's repository with the following files: +添加 Java 开发容器模板会将 `.devcontainer` 目录添加到项目存储库的根目录中,其中包含以下文件: - `devcontainer.json` - Dockerfile -The newly added `devcontainer.json` file defines a few properties that are described after the sample. +新添加的 `devcontainer.json` 文件定义了在示例之后描述的几个属性。 #### devcontainer.json @@ -61,55 +65,55 @@ The newly added `devcontainer.json` file defines a few properties that are descr // For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: // https://github.com/microsoft/vscode-dev-containers/tree/v0.159.0/containers/java { - "name": "Java", - "build": { - "dockerfile": "Dockerfile", - "args": { - // Update the VARIANT arg to pick a Java version: 11, 14 - "VARIANT": "11", - // Options - "INSTALL_MAVEN": "true", - "INSTALL_GRADLE": "false", - "INSTALL_NODE": "false", - "NODE_VERSION": "lts/*" - } - }, + "name": "Java", + "build": { + "dockerfile": "Dockerfile", + "args": { + // Update the VARIANT arg to pick a Java version: 11, 14 + "VARIANT": "11", + // Options + "INSTALL_MAVEN": "true", + "INSTALL_GRADLE": "false", + "INSTALL_NODE": "false", + "NODE_VERSION": "lts/*" + } + }, - // Set *default* container specific settings.json values on container create. - "settings": { - "terminal.integrated.shell.linux": "/bin/bash", - "java.home": "/docker-java-home", - "maven.executable.path": "/usr/local/sdkman/candidates/maven/current/bin/mvn" - }, + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.shell.linux": "/bin/bash", + "java.home": "/docker-java-home", + "maven.executable.path": "/usr/local/sdkman/candidates/maven/current/bin/mvn" + }, - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "vscjava.vscode-java-pack" - ], + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "vscjava.vscode-java-pack" + ], - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "java -version", + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "java -version", - // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode" + // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode" } ``` -- **name** - You can name your dev container anything, this is just the default. -- **build** - The build properties. - - **dockerfile** - In the `build` object, `dockerfile` contains the path to the Dockerfile that was also added from the template. +- name - 可以将开发容器命名为任何名称,这只是默认名称。 +- build - 生成属性。 + - dockerfile - 在 `build` 对象中,`dockerfile` 包含 Dockerfile 的路径,该文件也是从模板中添加的。 - **args** - - **variant**: This file only contains one build argument, which is the Java version that is passed into the Dockerfile. -- **settings** - These are {% data variables.product.prodname_vscode %} settings that you can set. - - **terminal.integrated.shell.linux** - While bash is the default here, you could use other terminal shells by modifying this. -- **extensions** - These are extensions included by default. - - **vscjava.vscode-java-pack** - The Java Extension Pack provides popular extensions for Java development to get you started. -- **forwardPorts** - Any ports listed here will be forwarded automatically. For more information, see "[Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)." -- **postCreateCommand** - Use this to run commands that aren't defined in the Dockerfile, after your codespace is created. -- **remoteUser** - By default, you’re running as the `vscode` user, but you can optionally set this to `root`. + - variant:此文件仅包含一个生成参数,即传递到 Dockerfile 的 Java 版本。 +- settings - 这些是你可以设置的 {% data variables.product.prodname_vscode %} 设置。 + - terminal.integrated.shell.linux - 虽然 bash 是此处的默认设置,但你可以通过修改它来使用其他终端 shell。 +- extensions - 这些是默认包含的扩展。 + - vscjava.vscode-java-pack - Java 扩展包为 Java 开发提供了常用的扩展,以帮助你入门。 +- **forwardPorts** - 此处列出的任何端口都将自动转发。 有关详细信息,请参阅“[在 codespace 中转发端口](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)。” +- postCreateCommand - 使用此方法在创建 codespace 后,运行未在 Dockerfile 中定义的命令。 +- **remoteUser** - 默认情况下以 `vscode` 用户身份运行,但可以选择将其设置为 `root`。 #### Dockerfile @@ -139,17 +143,17 @@ RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/shar # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 ``` -You can use the Dockerfile to add additional container layers to specify OS packages, Java versions, or global packages we want included in our container. +你可以使用 Dockerfile 添加其他容器层,以指定要包含在容器中的操作系统包、Java 版本或全局包。 -## Step 3: Modify your devcontainer.json file +## 步骤 3:修改 devcontainer.json 文件 -With your dev container configuration added and a basic understanding of what everything does, you can now make changes to customize your environment further. In this example, you'll add properties to install extensions and your project dependencies when your codespace launches. +添加了开发容器配置并基本了解所有功能之后,现在可以进行更改以进一步自定义你的环境。 在此示例中,您将在代码空间启动时添加属性以安装扩展和项目依赖项。 -1. In the Explorer, select the `devcontainer.json` file from the tree to open it. You might have to expand the `.devcontainer` folder to see it. +1. 在资源管理器中,从树中选择 `devcontainer.json` 文件以将其打开。 可能需要展开 `.devcontainer` 文件夹才能看到它。 - ![devcontainer.json file in the Explorer](/assets/images/help/codespaces/devcontainers-options.png) + ![Explorer 中的 devcontainer.json 文件](/assets/images/help/codespaces/devcontainers-options.png) -2. Add the following lines to your `devcontainer.json` file after `extensions`. +2. 将以下行添加到 `devcontainer.json` 文件的 `extensions` 之后: ```json{:copy} "postCreateCommand": "npm install", @@ -162,22 +166,22 @@ With your dev container configuration added and a basic understanding of what ev {% data reusables.codespaces.rebuild-reason %} -## Step 4: Run your application +## 步骤 4:运行应用程序 -In the previous section, you used the `postCreateCommand` to install a set of packages via npm. You can now use this to run our application with npm. +在上一部分中,你使用 `postCreateCommand` 通过 npm 安装了一组包。 您现在可以使用它来通过 npm 运行应用程序。 -1. Run your application by pressing `F5`. +1. 按 `F5` 运行应用程序。 -2. When your project starts, you should see a "toast" notification message at the bottom right corner of {% data variables.product.prodname_vscode_shortname %}, containing a prompt to connect to the port your project uses. +2. 项目启动时,应会在 {% data variables.product.prodname_vscode_shortname %} 的右下角看到一条“toast”通知消息,其中包含连接到项目使用的端口的提示。 - ![Port forwarding "toast" notification](/assets/images/help/codespaces/codespaces-port-toast.png) + ![端口转发“toast”通知](/assets/images/help/codespaces/codespaces-port-toast.png) -## Step 5: Commit your changes +## 步骤 5:提交更改 {% data reusables.codespaces.committing-link-to-procedure %} -## Next steps +## 后续步骤 -You should now be ready start developing your Java project in {% data variables.product.prodname_github_codespaces %}. Here are some additional resources for more advanced scenarios. +现在,你应该准备好了在 {% data variables.product.prodname_github_codespaces %} 中开始开发 Java 项目。 以下是用于更高级场景的一些额外资源。 {% data reusables.codespaces.next-steps-adding-devcontainer %} diff --git a/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-nodejs-project-for-codespaces.md b/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-nodejs-project-for-codespaces.md index b46287cc47..9614374f31 100644 --- a/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-nodejs-project-for-codespaces.md +++ b/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-nodejs-project-for-codespaces.md @@ -1,8 +1,8 @@ --- -title: Setting up your Node.js project for GitHub Codespaces +title: 为 GitHub Codespaces 设置 Node.js 项目 allowTitleToDifferFromFilename: true shortTitle: Setting up your Node.js project -intro: 'Get started with your JavaScript, Node.js, or TypeScript project in {% data variables.product.prodname_github_codespaces %} by creating a custom dev container.' +intro: '通过创建自定义开发容器,开始在 {% data variables.product.prodname_github_codespaces %} 中使用 JavaScript、Node.js 或 TypeScript 项目。' versions: fpt: '*' ghec: '*' @@ -16,54 +16,57 @@ topics: - JavaScript hasExperimentalAlternative: true hidden: true +ms.openlocfilehash: 19c29f7d3c8110d1c671a9af46227a399a467800 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159436' --- +## 简介 +本指南介绍如何设置 JavaScript、Node.js 或 TypeScript 项目 {% data reusables.codespaces.setting-up-project-intro %} +### 先决条件 -## Introduction +- 您应该在 {% data variables.product.prodname_dotcom_the_website %} 的仓库中有现有的 JavaScript、Node.js 或 TypeScript 项目。 如果没有项目,可以使用以下示例尝试本教程: https://github.com/microsoft/vscode-remote-try-node +- 必须为组织启用 {% data variables.product.prodname_github_codespaces %}。 -This guide shows you how to set up your JavaScript, Node.js, or TypeScript project {% data reusables.codespaces.setting-up-project-intro %} +## 步骤 1:在代码空间中打开项目 -### Prerequisites +1. 在存储库名称下,使用“{% octicon "code" aria-label="The code icon" %} 代码”下拉菜单,然后在“Codespaces”选项卡中,单击加号 ({% octicon "plus" aria-label="The plus icon" %}) 。 -- You should have an existing JavaScript, Node.js, or TypeScript project in a repository on {% data variables.product.prodname_dotcom_the_website %}. If you don't have a project, you can try this tutorial with the following example: https://github.com/microsoft/vscode-remote-try-node -- You must have {% data variables.product.prodname_github_codespaces %} enabled for your organization. + ![新建代码空间按钮](/assets/images/help/codespaces/new-codespace-button.png) -## Step 1: Open your project in a codespace - -1. Under the repository name, use the **{% octicon "code" aria-label="The code icon" %} Code** dropdown menu, and in the **Codespaces** tab, click the plus sign ({% octicon "plus" aria-label="The plus icon" %}). - - ![New codespace button](/assets/images/help/codespaces/new-codespace-button.png) - -When you create a codespace, your project is created on a remote VM that is dedicated to you. By default, the container for your codespace has many languages and runtimes including Node.js, JavaScript, Typescript, nvm, npm, and yarn. It also includes a common set of tools like git, wget, rsync, openssh, and nano. +创建代码空间时,您的项目是在专用于您的远程 VM 上创建的。 默认情况下,代码空间的容器有许多语言和运行时,包括 Node.js、JavaScript、Typescript、nvm、npm 和 yarn。 它还包括一套常见的工具,例如 git、wget、rsync、openssh 和 nano。 {% data reusables.codespaces.customize-vcpus-and-ram %} -## Step 2: Add a dev container configuration to your repository from a template +## 步骤 2:从模板将开发容器配置添加到存储库 -The default development container, or "dev container," for {% data variables.product.prodname_github_codespaces %} will support running Node.js projects like [vscode-remote-try-node](https://github.com/microsoft/vscode-remote-try-node) out of the box. However, we recommend that you configure your own dev container, as this allows you to define any particular tools and scripts your project needs. This will ensure a fully reproducible environment for all {% data variables.product.prodname_github_codespaces %} users in your repository. +{% data variables.product.prodname_github_codespaces %} 的默认开发容器将支持立即运行 [vscode-remote-try-node](https://github.com/microsoft/vscode-remote-try-node) 等 Node.js 项目。 但是,我们建议配置自己的开发容器,因为这样就可以定义项目所需的任何特定工具和脚本。 这将确保存储库中的所有 {% data variables.product.prodname_github_codespaces %} 用户都拥有完全可复制的环境。 {% data reusables.codespaces.setup-custom-devcontainer %} {% data reusables.codespaces.command-palette-container %} -1. For this example, click **Node.js**. If you need additional features you can select any container that’s specific to Node or a combination of tools such as Node and MongoDB. +1. 对于本示例,请单击“Node.js”。 如果需要其他功能,您可以选择任何特定于节点或工具(如节点和 MongoDB)组合的容器。 - ![Select Node option from the list](/assets/images/help/codespaces/add-node-prebuilt-container.png) + ![从列表中选择节点选项](/assets/images/help/codespaces/add-node-prebuilt-container.png) -1. Click the recommended version of Node.js. +1. 单击推荐的 Node.js 版本。 - ![Node.js version selection](/assets/images/help/codespaces/add-node-version.png) + ![Node.js 版本选择](/assets/images/help/codespaces/add-node-version.png) {% data reusables.codespaces.rebuild-command %} -### Anatomy of your dev container +### 开发容器的剖析 -Adding the Node.js dev container template adds a `.devcontainer` directory to the root of your project's repository with the following files: +添加 Node.js 开发容器模板会将 `.devcontainer` 目录添加到项目存储库的根目录中,其中包含以下文件: - `devcontainer.json` - Dockerfile -The newly added `devcontainer.json` file defines a few properties that are described after the sample. +新添加的 `devcontainer.json` 文件定义了在示例之后描述的几个属性。 #### devcontainer.json @@ -71,46 +74,46 @@ The newly added `devcontainer.json` file defines a few properties that are descr // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: // https://github.com/microsoft/vscode-dev-containers/tree/v0.162.0/containers/javascript-node { - "name": "Node.js", - "build": { - "dockerfile": "Dockerfile", - // Update 'VARIANT' to pick a Node version: 10, 12, 14 - "args": { "VARIANT": "14" } - }, + "name": "Node.js", + "build": { + "dockerfile": "Dockerfile", + // Update 'VARIANT' to pick a Node version: 10, 12, 14 + "args": { "VARIANT": "14" } + }, - // Set *default* container specific settings.json values on container create. - "settings": { - "terminal.integrated.shell.linux": "/bin/bash" - }, + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.shell.linux": "/bin/bash" + }, - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "dbaeumer.vscode-eslint" - ], + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "dbaeumer.vscode-eslint" + ], - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "yarn install", + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "yarn install", - // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "node" + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "node" } ``` -- **name** - You can name your dev container anything, this is just the default. -- **build** - The build properties. - - **dockerfile** - In the `build` object, `dockerfile` contains the path to the Dockerfile that was also added from the template. +- name - 可以将开发容器命名为任何名称,这只是默认名称。 +- build - 生成属性。 + - dockerfile - 在 `build` 对象中,`dockerfile` 包含 Dockerfile 的路径,该文件也是从模板中添加的。 - **args** - - **variant**: This file only contains one build argument, which is the node variant we want to use that is passed into the Dockerfile. -- **settings** - These are {% data variables.product.prodname_vscode %} settings that you can set. - - **terminal.integrated.shell.linux** - While bash is the default here, you could use other terminal shells by modifying this. -- **extensions** - These are extensions included by default. - - **dbaeumer.vscode-eslint** - ES lint is a great extension for linting, but for JavaScript there are a number of great Marketplace extensions you could also include. -- **forwardPorts** - Any ports listed here will be forwarded automatically. For more information, see "[Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)." -- **postCreateCommand** - Use this to run commands that aren't defined in the Dockerfile, after your codespace is created. -- **remoteUser** - By default, you’re running as the vscode user, but you can optionally set this to root. + - variant:此文件仅包含一个生成参数,即我们要使用并传递到 Dockerfile 的节点变体。 +- settings - 这些是你可以设置的 {% data variables.product.prodname_vscode %} 设置。 + - terminal.integrated.shell.linux - 虽然 bash 是此处的默认设置,但你可以通过修改它来使用其他终端 shell。 +- extensions - 这些是默认包含的扩展。 + - dbaeumer.vscode-eslint - ES lint 是 Lint 分析的良好扩展,但是对于 JavaScript,还可以包括许多出色的市场扩展。 +- **forwardPorts** - 此处列出的任何端口都将自动转发。 有关详细信息,请参阅“[在 codespace 中转发端口](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)。” +- postCreateCommand - 使用此方法在创建 codespace 后,运行未在 Dockerfile 中定义的命令。 +- **remoteUser** - 默认情况下以 vscode 用户身份运行,但可以选择将其设置为 root。 #### Dockerfile @@ -131,17 +134,17 @@ FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT} # RUN su node -c "npm install -g " ``` -You can use the Dockerfile to add additional container layers to specify OS packages, node versions, or global packages we want included in our container. +您可以使用 Dockerfile 添加其他容器层,以指定要包含在容器中的操作系统包、节点版本或全局包。 -## Step 3: Modify your devcontainer.json file +## 步骤 3:修改 devcontainer.json 文件 -With your dev container configuration added and a basic understanding of what everything does, you can now make changes to customize your environment further. In this example, you'll add properties to install npm when your codespace launches and make a list of ports inside the container available locally. +添加了开发容器配置并基本了解所有功能之后,现在可以进行更改以进一步自定义你的环境。 在此示例中,您将添加属性以在代码空间启动时安装 npm,并使容器内的端口列表在本地可用。 -1. In the Explorer, select the `devcontainer.json` file from the tree to open it. You might have to expand the `.devcontainer` folder to see it. +1. 在资源管理器中,从树中选择 `devcontainer.json` 文件以将其打开。 可能需要展开 `.devcontainer` 文件夹才能看到它。 - ![devcontainer.json file in the Explorer](/assets/images/help/codespaces/devcontainers-options.png) + ![Explorer 中的 devcontainer.json 文件](/assets/images/help/codespaces/devcontainers-options.png) -2. Add the following lines to your `devcontainer.json` file after `extensions`: +2. 将以下行添加到 `devcontainer.json` 文件的 `extensions` 之后: ```json{:copy} "postCreateCommand": "npm install", @@ -154,24 +157,24 @@ With your dev container configuration added and a basic understanding of what ev {% data reusables.codespaces.rebuild-reason %} -## Step 4: Run your application +## 步骤 4:运行应用程序 -In the previous section, you used the `postCreateCommand` to installing a set of packages via npm. You can now use this to run our application with npm. +在上一部分中,你使用 `postCreateCommand` 通过 npm 安装了一组包。 您现在可以使用它来通过 npm 运行应用程序。 -1. Run your start command in the terminal with`npm start`. +1. 在终端中使用 `npm start` 运行启动命令。 - ![npm start in terminal](/assets/images/help/codespaces/codespaces-npmstart.png) + ![终端的 npm 启动](/assets/images/help/codespaces/codespaces-npmstart.png) -2. When your project starts, you should see a "toast" notification message at the bottom right corner of {% data variables.product.prodname_vscode_shortname %}, containing a prompt to connect to the port your project uses. +2. 项目启动时,应会在 {% data variables.product.prodname_vscode_shortname %} 的右下角看到一条“toast”通知消息,其中包含连接到项目使用的端口的提示。 - ![Port forwarding "toast" notification](/assets/images/help/codespaces/codespaces-port-toast.png) + ![端口转发“toast”通知](/assets/images/help/codespaces/codespaces-port-toast.png) -## Step 5: Commit your changes +## 步骤 5:提交更改 {% data reusables.codespaces.committing-link-to-procedure %} -## Next steps +## 后续步骤 -You should now be ready start developing your JavaScript project in {% data variables.product.prodname_github_codespaces %}. Here are some additional resources for more advanced scenarios. +现在,你应该准备好了在 {% data variables.product.prodname_github_codespaces %} 中开始开发 JavaScript 项目。 以下是用于更高级场景的一些额外资源。 {% data reusables.codespaces.next-steps-adding-devcontainer %} diff --git a/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-python-project-for-codespaces.md b/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-python-project-for-codespaces.md index 6b6e352488..f9631c4c3b 100644 --- a/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-python-project-for-codespaces.md +++ b/translations/zh-CN/content/codespaces/setting-up-your-project-for-codespaces/setting-up-your-python-project-for-codespaces.md @@ -1,8 +1,8 @@ --- -title: Setting up your Python project for GitHub Codespaces +title: 为 GitHub Codespaces 设置 Python 项目 allowTitleToDifferFromFilename: true shortTitle: Setting up your Python project -intro: 'Get started with your Python project in {% data variables.product.prodname_github_codespaces %} by creating a custom dev container.' +intro: '通过创建自定义开发容器,开始在 {% data variables.product.prodname_github_codespaces %} 中使用 Python 项目。' versions: fpt: '*' ghec: '*' @@ -15,113 +15,117 @@ topics: - Python hasExperimentalAlternative: true hidden: true +ms.openlocfilehash: 2d9c627907f447a3efd873fceba963b899b57c39 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159422' --- +## 简介 -## Introduction +本指南介绍如何设置 Python 项目 {% data reusables.codespaces.setting-up-project-intro %} -This guide shows you how to set up your Python project {% data reusables.codespaces.setting-up-project-intro %} +### 先决条件 -### Prerequisites +- 您应该在 {% data variables.product.prodname_dotcom_the_website %} 的仓库中有现有的 Python 项目。 如果没有项目,可以使用以下示例尝试本教程: https://github.com/2percentsilk/python-quickstart 。 +- 必须为组织启用 {% data variables.product.prodname_github_codespaces %}。 -- You should have an existing Python project in a repository on {% data variables.product.prodname_dotcom_the_website %}. If you don't have a project, you can try this tutorial with the following example: https://github.com/2percentsilk/python-quickstart. -- You must have {% data variables.product.prodname_github_codespaces %} enabled for your organization. +## 步骤 1:在代码空间中打开项目 -## Step 1: Open your project in a codespace +1. 在存储库名称下,使用“{% octicon "code" aria-label="The code icon" %} 代码”下拉菜单,然后在“Codespaces”选项卡中,单击加号 ({% octicon "plus" aria-label="The plus icon" %}) 。 -1. Under the repository name, use the **{% octicon "code" aria-label="The code icon" %} Code** dropdown menu, and in the **Codespaces** tab, click the plus sign ({% octicon "plus" aria-label="The plus icon" %}). + ![新建代码空间按钮](/assets/images/help/codespaces/new-codespace-button.png) - ![New codespace button](/assets/images/help/codespaces/new-codespace-button.png) - -When you create a codespace, your project is created on a remote VM that is dedicated to you. By default, the container for your codespace has many languages and runtimes including Node.js, JavaScript, Typescript, nvm, npm, and yarn. It also includes a common set of tools like git, wget, rsync, openssh, and nano. +创建代码空间时,您的项目是在专用于您的远程 VM 上创建的。 默认情况下,代码空间的容器有许多语言和运行时,包括 Node.js、JavaScript、Typescript、nvm、npm 和 yarn。 它还包括一套常见的工具,例如 git、wget、rsync、openssh 和 nano。 {% data reusables.codespaces.customize-vcpus-and-ram %} -## Step 2: Add a dev container configuration to your repository from a template +## 步骤 2:从模板将开发容器配置添加到存储库 -The default development container, or "dev container," for {% data variables.product.prodname_github_codespaces %} comes with the latest Python version, package managers (pip, Miniconda), and other common tools preinstalled. However, we recommend that you configure your own dev container to include all of the tools and scripts that your project needs. This will ensure a fully reproducible environment for all {% data variables.product.prodname_github_codespaces %} users in your repository. +{% data variables.product.prodname_github_codespaces %} 的默认开发容器预先安装了最新的 Python 版本、包管理器(pip、Miniconda)和其他常用工具。 但是,我们建议配置自己的开发容器,以包含项目所需的所有工具和脚本。 这将确保存储库中的所有 {% data variables.product.prodname_github_codespaces %} 用户都拥有完全可复制的环境。 {% data reusables.codespaces.setup-custom-devcontainer %} {% data reusables.codespaces.command-palette-container %} -1. For this example, click **Python 3**. If you need additional features you can select any container that’s specific to Python or a combination of tools such as Python 3 and PostgreSQL. - ![Select Python option from the list](/assets/images/help/codespaces/add-python-prebuilt-container.png) -1. Click the recommended version of Python. - ![Python version selection](/assets/images/help/codespaces/add-python-version.png) -1. Accept the default option to add Node.js to your customization. - ![Add Node.js selection](/assets/images/help/codespaces/add-nodejs-selection.png) -{% data reusables.codespaces.rebuild-command %} +1. 对于本示例,请单击“Python 3”。 如果需要其他功能,您可以选择任何特定于 Python 或工具(如 Python 3 和 PostgreSQL)组合的容器。 + ![从列表中选择 Python 选项](/assets/images/help/codespaces/add-python-prebuilt-container.png) +1. 单击推荐的 Python 版本。 + ![Python 版本选择](/assets/images/help/codespaces/add-python-version.png) +1. 接受默认选项,将 Node.js 添加到您的自定义中。 + ![添加 Node.js 选择](/assets/images/help/codespaces/add-nodejs-selection.png) {% data reusables.codespaces.rebuild-command %} -### Anatomy of your dev container +### 开发容器的剖析 -Adding the Python dev container template adds a `.devcontainer` directory to the root of your project's repository with the following files: +添加 Python 开发容器模板会将 `.devcontainer` 目录添加到项目存储库的根目录中,其中包含以下文件: - `devcontainer.json` - Dockerfile -The newly added `devcontainer.json` file defines a few properties that are described after the sample. +新添加的 `devcontainer.json` 文件定义了在示例之后描述的几个属性。 #### devcontainer.json ```json { - "name": "Python 3", - "build": { - "dockerfile": "Dockerfile", - "context": "..", - "args": { - // Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9 - "VARIANT": "3", - // Options - "INSTALL_NODE": "true", - "NODE_VERSION": "lts/*" - } - }, + "name": "Python 3", + "build": { + "dockerfile": "Dockerfile", + "context": "..", + "args": { + // Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9 + "VARIANT": "3", + // Options + "INSTALL_NODE": "true", + "NODE_VERSION": "lts/*" + } + }, - // Set *default* container specific settings.json values on container create. - "settings": { - "terminal.integrated.shell.linux": "/bin/bash", - "python.pythonPath": "/usr/local/bin/python", - "python.linting.enabled": true, - "python.linting.pylintEnabled": true, - "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8", - "python.formatting.blackPath": "/usr/local/py-utils/bin/black", - "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf", - "python.linting.banditPath": "/usr/local/py-utils/bin/bandit", - "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8", - "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", - "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle", - "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", - "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint" - }, + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.shell.linux": "/bin/bash", + "python.pythonPath": "/usr/local/bin/python", + "python.linting.enabled": true, + "python.linting.pylintEnabled": true, + "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8", + "python.formatting.blackPath": "/usr/local/py-utils/bin/black", + "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf", + "python.linting.banditPath": "/usr/local/py-utils/bin/bandit", + "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8", + "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", + "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle", + "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", + "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint" + }, - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "ms-python.python" - ], + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-python.python" + ], - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "pip3 install --user -r requirements.txt", + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "pip3 install --user -r requirements.txt", - // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode" + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode" } ``` -- **name** - You can name our dev container anything, this is just the default. -- **build** - The build properties. - - **dockerfile** - In the `build` object, `dockerfile` contains the path to the Dockerfile that was also added from the template. +- name - 可以将开发容器命名为任何名称,这只是默认名称。 +- build - 生成属性。 + - dockerfile - 在 `build` 对象中,`dockerfile` 包含 Dockerfile 的路径,该文件也是从模板中添加的。 - **args** - - **variant**: This file only contains one build argument, which is the node variant we want to use that is passed into the Dockerfile. -- **settings** - These are {% data variables.product.prodname_vscode %} settings. - - **terminal.integrated.shell.linux** - While bash is the default here, you could use other terminal shells by modifying this. -- **extensions** - These are extensions included by default. - - **ms-python.python** - The Microsoft Python extension provides rich support for the Python language (for all actively supported versions of the language: >=3.6), including features such as IntelliSense, linting, debugging, code navigation, code formatting, refactoring, variable explorer, test explorer, and more. -- **forwardPorts** - Any ports listed here will be forwarded automatically. For more information, see "[Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)." -- **postCreateCommand** - Use this to run commands that aren't defined in the Dockerfile, like `pip3 install -r requirements`, after your codespace is created. -- **remoteUser** - By default, you’re running as the `vscode` user, but you can optionally set this to `root`. + - variant:此文件仅包含一个生成参数,即我们要使用并传递到 Dockerfile 的节点变体。 +- settings - 这些是 {% data variables.product.prodname_vscode %} 设置。 + - terminal.integrated.shell.linux - 虽然 bash 是此处的默认设置,但你可以通过修改它来使用其他终端 shell。 +- extensions - 这些是默认包含的扩展。 + - **ms-python.python** - Microsoft Python 扩展为 Python 语言提供丰富的支持(对于所有有效支持的语言版本:>=3.6),包括 IntelliSense、linting、调试、代码导航、代码格式化、重构、变量资源管理器、测试资源管理器等功能。 +- **forwardPorts** - 此处列出的任何端口都将自动转发。 有关详细信息,请参阅“[在 codespace 中转发端口](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)。” +- postCreateCommand - 使用此方法在创建 codespace 后,运行未在 Dockerfile 中定义的命令,例如 `pip3 install -r requirements`。 +- **remoteUser** - 默认情况下以 `vscode` 用户身份运行,但可以选择将其设置为 `root`。 #### Dockerfile @@ -148,27 +152,27 @@ RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/l # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 ``` -You can use the Dockerfile to add additional container layers to specify OS packages, node versions, or global packages we want included in our container. +您可以使用 Dockerfile 添加其他容器层,以指定要包含在容器中的操作系统包、节点版本或全局包。 -## Step 3: Modify your devcontainer.json file +## 步骤 3:修改 devcontainer.json 文件 -With your dev container configuration added and a basic understanding of what everything does, you can now make changes to customize your environment further. In this example, you'll add properties to install extensions and your project dependencies when your codespace launches. +添加了开发容器配置并基本了解所有功能之后,现在可以进行更改以进一步自定义你的环境。 在此示例中,您将在代码空间启动时添加属性以安装扩展和项目依赖项。 -1. In the Explorer, expand the `.devcontainer` folder and select the `devcontainer.json` file from the tree to open it. +1. 在资源管理器中,展开 `.devcontainer` 文件夹,然后从树中选择 `devcontainer.json` 文件以将其打开。 - ![devcontainer.json file in the Explorer](/assets/images/help/codespaces/devcontainers-options.png) + ![Explorer 中的 devcontainer.json 文件](/assets/images/help/codespaces/devcontainers-options.png) -2. Update the `extensions` list in your `devcontainer.json` file to add a few extensions that are useful when working with your project. +2. 更新 `devcontainer.json` 文件中的 `extensions` 列表,以添加一些在处理项目时有用的扩展。 ```json{:copy} "extensions": [ - "ms-python.python", - "cstrap.flask-snippets", - "streetsidesoftware.code-spell-checker" - ], + "ms-python.python", + "cstrap.flask-snippets", + "streetsidesoftware.code-spell-checker" + ], ``` -3. Uncomment the `postCreateCommand` to auto-install requirements as part of the codespaces setup process. +3. 在代码空间设置过程中取消注释 `postCreateCommand` 以自动安装要求。 ```json{:copy} // Use 'postCreateCommand' to run commands after the container is created. @@ -179,26 +183,26 @@ With your dev container configuration added and a basic understanding of what ev {% data reusables.codespaces.rebuild-reason %} -5. Check your changes were successfully applied by verifying the Code Spell Checker and Flask Snippet extensions were installed. +5. 通过验证是否安装了 Code Spell Checker 和 Flask Snippet 扩展,检查更改是否成功应用。 - ![Extensions list](/assets/images/help/codespaces/python-extensions.png) + ![扩展列表](/assets/images/help/codespaces/python-extensions.png) -## Step 4: Run your application +## 步骤 4:运行应用程序 -In the previous section, you used the `postCreateCommand` to install a set of packages via pip3. With your dependencies now installed, you can run your application. +在上一部分中,你使用 `postCreateCommand` 通过 pip3 安装了一组包。 现已安装您的依赖项,您可以运行应用程序。 -1. Run your application by pressing `F5` or entering `python -m flask run` in the codespace terminal. +1. 通过按 `F5` 或在 codespace 终端中输入 `python -m flask run` 来运行你的应用程序。 -2. When your project starts, you should see a "toast" notification message at the bottom right corner of {% data variables.product.prodname_vscode_shortname %}, containing a prompt to connect to the port your project uses. +2. 项目启动时,应会在 {% data variables.product.prodname_vscode_shortname %} 的右下角看到一条“toast”通知消息,其中包含连接到项目使用的端口的提示。 - ![Port forwarding "toast" notification](/assets/images/help/codespaces/python-port-forwarding.png) + ![端口转发“toast”通知](/assets/images/help/codespaces/python-port-forwarding.png) -## Step 5: Commit your changes +## 步骤 5:提交更改 {% data reusables.codespaces.committing-link-to-procedure %} -## Next steps +## 后续步骤 -You should now be ready start developing your Python project in {% data variables.product.prodname_github_codespaces %}. Here are some additional resources for more advanced scenarios. +现在,应准备开始在 {% data variables.product.prodname_github_codespaces %} 中开发 Python 项目。 以下是用于更高级场景的一些额外资源。 {% data reusables.codespaces.next-steps-adding-devcontainer %} diff --git a/translations/zh-CN/content/codespaces/troubleshooting/exporting-changes-to-a-branch.md b/translations/zh-CN/content/codespaces/troubleshooting/exporting-changes-to-a-branch.md index d8f3a8ecd5..9e32e3293c 100644 --- a/translations/zh-CN/content/codespaces/troubleshooting/exporting-changes-to-a-branch.md +++ b/translations/zh-CN/content/codespaces/troubleshooting/exporting-changes-to-a-branch.md @@ -1,6 +1,6 @@ --- -title: Exporting changes to a branch -intro: This article provides steps for exporting your codespace changes to a branch. +title: 将更改导出到分支 +intro: 本文提供将代码空间更改导出到分支的步骤。 versions: fpt: '*' ghec: '*' @@ -8,20 +8,25 @@ type: reference topics: - Codespaces shortTitle: Exporting changes +ms.openlocfilehash: 2a7dee4725af31f3983e753b4202f94be1742556 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159437' --- +## 将更改导出到分支 -## Exporting changes to a branch +使用 {% data variables.product.prodname_github_codespaces %} 时,你可能希望将更改导出到分支,而无需启动 codespace。 当达到[支出限制](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces)或在访问 codespace 时遇到一般性问题时,这会很有用。 -While using {% data variables.product.prodname_github_codespaces %}, you may want to export your changes to a branch without launching your codespace. This can be useful when you have hit a [spending limit](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces) or have a general issue accessing your codespace. +如果未发布 codespace(通过模板创建,并且未与 {% data variables.product.product_name %} 上的存储库相关联),则无法将更改导出到分支,但无需启动 codespace 即可将 codespace 发布到新存储库。 有关详细信息,请参阅“[通过模板创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template#publishing-from-githubcom)”。 -If your codespace is unpublished (created from a template and not associated with a repository on {% data variables.product.product_name %}), then you won't be able to export changes to a branch, but you can publish the codespace to a new repository without launching the codespace. For more information, see "[Creating a codespace from a template](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template#publishing-from-githubcom)." +将更改导出到分支: -To export your changes to a branch: +{% data reusables.codespaces.your-codespaces-procedure-step %} 或者,对于单个存储库,单击“{% octicon "code" aria-label="The code icon" %} 代码”菜单。 +1. 单击要从中导出的 codespace 右侧的省略号 (...)。 +2. 选择“{% octicon "git-branch" aria-label="The git branch icon" %} 将更改导出到分支”。 -{% data reusables.codespaces.your-codespaces-procedure-step %} Or, for an individual repository, click the **{% octicon "code" aria-label="The code icon" %} Code** menu. -1. Click the ellipsis (**...**) to the right of the codespace you want to export from. -2. Select **{% octicon "git-branch" aria-label="The git branch icon" %} Export changes to branch**. + ![将更改导出到分支](/assets/images/help/codespaces/export-changes-to-a-branch.png) - ![Export changes to a branch](/assets/images/help/codespaces/export-changes-to-a-branch.png) - -1. From the popover, select **Create branch**. +1. 从弹出窗口中选择“创建分支”。 diff --git a/translations/zh-CN/content/codespaces/troubleshooting/github-codespaces-logs.md b/translations/zh-CN/content/codespaces/troubleshooting/github-codespaces-logs.md index e5acb48518..fe44b877cb 100644 --- a/translations/zh-CN/content/codespaces/troubleshooting/github-codespaces-logs.md +++ b/translations/zh-CN/content/codespaces/troubleshooting/github-codespaces-logs.md @@ -1,6 +1,6 @@ --- -title: GitHub Codespaces logs -intro: 'Overview of the logs used by {% data variables.product.prodname_github_codespaces %}.' +title: GitHub Codespaces 日志 +intro: '{% data variables.product.prodname_github_codespaces %} 使用的日志概述。' versions: fpt: '*' ghec: '*' @@ -11,50 +11,55 @@ topics: shortTitle: Codespaces logs redirect_from: - /codespaces/troubleshooting/codespaces-logs +ms.openlocfilehash: f5cd482888f58f85a051bb9b6e2c5d7c026ed9a9 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159485' --- - {% jetbrains %} {% data reusables.codespaces.codespaces-jetbrains-beta-note %} {% endjetbrains %} -Information on {% data variables.product.prodname_github_codespaces %} is output to various logs: +有关 {% data variables.product.prodname_github_codespaces %} 的信息将输出到各种日志: {% webui %} -- Codespace logs -- Creation logs -- Browser console logs (for the {% data variables.product.prodname_vscode_shortname %} web client) +- 代码空间日志 +- 创建日志 +- 浏览器控制台日志(用于 {% data variables.product.prodname_vscode_shortname %} Web 客户端) -Extension logs are available if you are using {% data variables.product.prodname_github_codespaces %} in {% data variables.product.prodname_vscode_shortname %}. Click the "{% data variables.product.prodname_vscode %}" tab above for details. +如果要在 {% data variables.product.prodname_vscode_shortname %} 中使用 {% data variables.product.prodname_github_codespaces %},则可以使用扩展日志。 单击上面的“{% data variables.product.prodname_vscode %}”选项卡,了解详细信息。 {% endwebui %} {% vscode %} -- Codespace logs -- Creation logs -- Extension logs (for the {% data variables.product.prodname_vscode_shortname %} desktop application) +- 代码空间日志 +- 创建日志 +- 扩展日志(用于 {% data variables.product.prodname_vscode_shortname %} 桌面应用程序) -Browser logs are available if you are using {% data variables.product.prodname_github_codespaces %} in your browser. Click the "Web browser" tab above for details. +如果要在浏览器中使用 {% data variables.product.prodname_github_codespaces %},则可以使用浏览器日志。 单击上面的“Web 浏览器”选项卡,了解详细信息。 {% endvscode %} {% cli %} -- Codespace logs -- Creation logs +- 代码空间日志 +- 创建日志 -Other logs are available if you are using {% data variables.product.prodname_github_codespaces %} in {% data variables.product.prodname_vscode_shortname %} or in your web browser. Click the tabs above for details. +如果要在 {% data variables.product.prodname_vscode_shortname %} 或 Web 浏览器中使用 {% data variables.product.prodname_github_codespaces %},则可以使用其他日志。 单击上面的选项卡以了解详细信息。 {% endcli %} {% jetbrains %} -- Creation logs +- 创建日志 -Other logs are available if you are using {% data variables.product.prodname_github_codespaces %} in {% data variables.product.prodname_vscode_shortname %} or in your web browser. Click the tabs above for details. +如果要在 {% data variables.product.prodname_vscode_shortname %} 或 Web 浏览器中使用 {% data variables.product.prodname_github_codespaces %},则可以使用其他日志。 单击上面的选项卡以了解详细信息。 {% endjetbrains %} @@ -62,10 +67,10 @@ Other logs are available if you are using {% data variables.product.prodname_git {% data reusables.codespaces.codespace-logs %} -1. If you are using {% data variables.product.prodname_github_codespaces %} in the browser, ensure that you are connected to the codespace you want to debug. -1. Open the {% data variables.product.prodname_vscode_command_palette_shortname %} (Shift+Command+P (Mac) / Ctrl+Shift+P (Windows/Linux)) and type **Export logs**. Select **Codespaces: Export Logs** from the list to download the logs. -1. Define where to save the zip archive of logs then click **Save** (desktop) or click **OK** (web). -1. If you are using {% data variables.product.prodname_github_codespaces %} in the browser, right-click on the zip archive of logs from the Explorer view and select **Download…** to download them to your local machine. +1. 如果要在浏览器中使用 {% data variables.product.prodname_github_codespaces %},请确保已连接到要调试的 codespace。 +1. 打开 {% data variables.product.prodname_vscode_command_palette_shortname %} (Shift+Command+P (Mac)/Ctrl+Shift+P (Windows/Linux)),然后键入“导出日志”。 从列表中选择“Codespaces: 导出日志”以下载日志。 +1. 定义保存日志 zip 存档的位置,然后单击“保存”(桌面),或单击“确定”(Web) 。 +1. 如果要在浏览器中使用 {% data variables.product.prodname_github_codespaces %},请右键单击“资源管理器”视图中日志的 zip 存档,然后选择“下载…” 将其下载到本地计算机。 {% endwebui %} @@ -73,8 +78,8 @@ Other logs are available if you are using {% data variables.product.prodname_git {% data reusables.codespaces.codespace-logs %} -1. Open the {% data variables.product.prodname_vscode_command_palette_shortname %} (Shift+Command+P (Mac) / Ctrl+Shift+P (Windows/Linux)) and type **Export logs**. Select **Codespaces: Export Logs** from the list to download the logs. -1. Define where to save the zip archive of logs then click **Save** (desktop) or click **OK** (web). +1. 打开 {% data variables.product.prodname_vscode_command_palette_shortname %} (Shift+Command+P (Mac)/Ctrl+Shift+P (Windows/Linux)),然后键入“导出日志”。 从列表中选择“Codespaces: 导出日志”以下载日志。 +1. 定义保存日志 zip 存档的位置,然后单击“保存”(桌面),或单击“确定”(Web) 。 {% endvscode %} @@ -82,28 +87,28 @@ Other logs are available if you are using {% data variables.product.prodname_git {% data reusables.codespaces.codespace-logs %} -Currently you can't use {% data variables.product.prodname_cli %} to access these logs. To access them, open your codespace in {% data variables.product.prodname_vscode_shortname %} or in a browser. +目前,您无法使用 {% data variables.product.prodname_cli %} 来访问这些日志。 要访问它们,请在 {% data variables.product.prodname_vscode_shortname %} 或浏览器中打开 codespace。 {% endcli %} -## Creation logs +## 创建日志 -These logs contain information about the container, dev container, and their configuration. They are useful for debugging configuration and setup problems. +这些日志包含有关容器、开发容器及其配置的信息。 它们对于调试配置和设置问题非常有用。 {% webui %} -1. Connect to the codespace you want to debug. -2. Open the {% data variables.product.prodname_vscode_command_palette_shortname %} (Shift+Command+P (Mac) / Ctrl+Shift+P (Windows/Linux)) and type **Creation logs**. Select **Codespaces: View Creation Log** from the list to open the `creation.log` file. +1. 连接到要调试的代码空间。 +2. 打开 {% data variables.product.prodname_vscode_command_palette_shortname %} (Shift+Command+P (Mac)/Ctrl+Shift+P (Windows/Linux)),然后键入“创建日志”。 从列表中选择“Codespaces: 查看创建日志”以打开 `creation.log` 文件。 -If you want to share the log with support, you can copy the text from the creation log into a text editor and save the file locally. +如果要与支持人员共享日志,可以将创建日志中的文本复制到文本编辑器中,并将文件保存在本地。 {% endwebui %} {% vscode %} -Open the {% data variables.product.prodname_vscode_command_palette_shortname %} (Shift+Command+P (Mac) / Ctrl+Shift+P (Windows/Linux)) and type **Creation logs**. Select **Codespaces: View Creation Log** from the list to open the `creation.log` file. +打开 {% data variables.product.prodname_vscode_command_palette_shortname %} (Shift+Command+P (Mac)/Ctrl+Shift+P (Windows/Linux)),然后键入“创建日志”。 从列表中选择“Codespaces: 查看创建日志”以打开 `creation.log` 文件。 -If you want to share the log with support, you can copy the text from the creation log into a text editor and save the file locally. +如果要与支持人员共享日志,可以将创建日志中的文本复制到文本编辑器中,并将文件保存在本地。 {% endvscode %} @@ -111,15 +116,15 @@ If you want to share the log with support, you can copy the text from the creati {% data reusables.cli.cli-learn-more %} -To see the creation log use the `gh codespace logs` subcommand. After entering the command choose from the list of codespaces that's displayed. +若要查看创建日志,请使用 `gh codespace logs` 子命令。 输入命令后,从显示的代码空间列表中进行选择。 ```shell gh codespace logs ``` -For more information about this command, see [the {% data variables.product.prodname_cli %} manual](https://cli.github.com/manual/gh_codespace_logs). +有关此命令的详细信息,请参阅 [{% data variables.product.prodname_cli %} 手册](https://cli.github.com/manual/gh_codespace_logs)。 -If you want to share the log with support, you can save the output to a file: +如果要与支持人员共享日志,可以将输出保存到一个文件中: ```shell gh codespace logs -c > /path/to/logs.txt @@ -129,44 +134,44 @@ gh codespace logs -c > /path/to/logs.txt {% vscode %} -## Extension logs +## 扩展日志 -These logs are available for {% data variables.product.prodname_vscode_shortname %} desktop users only. They are useful if it seems like the {% data variables.product.prodname_github_codespaces %} extension or {% data variables.product.prodname_vscode_shortname %} editor are having issues that prevent creation or connection. +这些日志仅适用于 {% data variables.product.prodname_vscode_shortname %} 桌面用户。 如果看起来 {% data variables.product.prodname_github_codespaces %} 扩展或 {% data variables.product.prodname_vscode_shortname %} 编辑器遇到阻止创建或连接的问题,则它们很有用。 -1. In {% data variables.product.prodname_vscode_shortname %}, open the Command Palette. -1. Type **Logs** and select **Developer: Open Extension Logs Folder** from the list to open the extension log folder in your system's file explorer. +1. 在 {% data variables.product.prodname_vscode_shortname %} 中,打开命令面板。 +1. 键入“日志”,然后从列表中选择“开发人员: 打开扩展日志文件夹”,以便在系统的文件资源管理器中打开扩展日志文件夹 。 -From this view, you can access logs generated by the various extensions that you use in {% data variables.product.prodname_vscode_shortname %}. You will see logs for {% data variables.product.prodname_github_codespaces %}, {% data variables.product.prodname_dotcom %} Authentication, and Git, in addition to any other extensions you have enabled. +在此视图中,可以访问由在 {% data variables.product.prodname_vscode_shortname %} 中使用的各种扩展生成的日志。 除了已启用的任何其他扩展外,还将看到 {% data variables.product.prodname_github_codespaces %}、{% data variables.product.prodname_dotcom %} 身份验证和 Git 的日志。 {% endvscode %} {% webui %} -## Browser console logs +## 浏览器控制台日志 -These logs are useful only if you want to debug problems with using {% data variables.product.prodname_github_codespaces %} in the browser. They are useful for debugging problems creating and connecting to {% data variables.product.prodname_github_codespaces %}. +仅当想要调试在浏览器中使用 {% data variables.product.prodname_github_codespaces %} 的问题时,这些日志才有用。 对于调试创建和连接到 {% data variables.product.prodname_github_codespaces %} 的问题,它们非常有用。 -1. In the browser window for the codespace you want to debug, open the developer tools window. -1. Display the "Console" tab and click **errors** in the left sidebar to show only the errors. -1. In the log area on the right, right-click and select **Save as** to save a copy of the errors to your local machine. - ![Save errors](/assets/images/help/codespaces/browser-console-log-save.png) +1. 在要调试的代码空间的浏览器窗口中,打开开发人员工具窗口。 +1. 显示“控制”选项卡,然后单击左侧边栏中的“错误”以仅显示错误。 +1. 在右侧的日志区域中,右键单击并选择“另存为”将错误的副本保存到本地计算机。 + ![保存错误](/assets/images/help/codespaces/browser-console-log-save.png) {% endwebui %} {% jetbrains %} {% data reusables.codespaces.jetbrains-open-codespace-plugin %} -1. In the {% data variables.product.prodname_github_codespaces %} tool window, click the log icon. +1. 在 {% data variables.product.prodname_github_codespaces %} 工具窗口中,单击日志图标。 - ![Screenshot of the log button](/assets/images/help/codespaces/jetbrains-plugin-icon-log.png) + ![“日志”按钮的屏幕截图](/assets/images/help/codespaces/jetbrains-plugin-icon-log.png) -## JetBrains logs +## JetBrains 日志 -You can download logs for the remote JetBrains IDE and the local client application by going to the **Help** menu in the JetBrains client application and clicking **Collect Host and Client Logs**. +通过转到 JetBrains 客户端应用程序中的“帮助”菜单并单击“收集主机和客户端日志”,来下载远程 JetBrains IDE 和本地客户端应用程序的日志 。 {% endjetbrains %} -## Further reading +## 延伸阅读 -- "[Reviewing your organization's audit logs for {% data variables.product.prodname_github_codespaces %}](/codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-github-codespaces)" -- "[Reviewing your security logs for {% data variables.product.prodname_github_codespaces %}](/codespaces/managing-your-codespaces/reviewing-your-security-logs-for-github-codespaces)" \ No newline at end of file +- “[查看 {% data variables.product.prodname_github_codespaces %} 的组织审核日志](/codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-github-codespaces)” +- “[查看 {% data variables.product.prodname_github_codespaces %} 的安全日志](/codespaces/managing-your-codespaces/reviewing-your-security-logs-for-github-codespaces)” diff --git a/translations/zh-CN/content/codespaces/troubleshooting/index.md b/translations/zh-CN/content/codespaces/troubleshooting/index.md index cabc8b2247..6914ac5f35 100644 --- a/translations/zh-CN/content/codespaces/troubleshooting/index.md +++ b/translations/zh-CN/content/codespaces/troubleshooting/index.md @@ -1,7 +1,7 @@ --- -title: Troubleshooting GitHub Codespaces +title: GitHub Codespaces 故障排除 shortTitle: Troubleshooting -intro: 'These guides provide information for troubleshooting {% data variables.product.prodname_github_codespaces %}' +intro: '这些指南提供了有关 {% data variables.product.prodname_github_codespaces %} 疑难解答的信息' versions: fpt: '*' ghec: '*' @@ -21,5 +21,11 @@ children: - /troubleshooting-github-codespaces-clients - /troubleshooting-gpg-verification-for-github-codespaces - /working-with-support-for-github-codespaces +ms.openlocfilehash: 8704695a9ae39750bcc94229a62bb7eabcc6cdbe +ms.sourcegitcommit: 47e03737d09bed84dfedb7be5924d893d34ea1a8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/16/2022 +ms.locfileid: '148167091' --- diff --git a/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-creation-and-deletion-of-codespaces.md b/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-creation-and-deletion-of-codespaces.md index e9c7c4560c..1598191d8d 100644 --- a/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-creation-and-deletion-of-codespaces.md +++ b/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-creation-and-deletion-of-codespaces.md @@ -1,6 +1,6 @@ --- -title: Troubleshooting creation and deletion of codespaces -intro: 'This article provides troubleshooting steps for common issues you may experience when creating or deleting a codespace, including storage and configuration issues.' +title: codespace 的创建和删除故障排除 +intro: 本文提供了在创建或删除代码空间时可能遇到的常见问题(包括存储和配置问题)的疑难解答步骤。 versions: fpt: '*' ghec: '*' @@ -8,89 +8,94 @@ type: reference topics: - Codespaces shortTitle: Creation and deletion +ms.openlocfilehash: 09c3a73ec5e41f0170f1d3cd66df139bb2a497e5 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158691' --- +## 创建代码空间 -## Creating codespaces +### 没有创建代码空间的权限 +{% data variables.product.prodname_github_codespaces %} 并非对所有存储库都可用。 如果未显示用于创建 codespace 的选项,则 {% data variables.product.prodname_github_codespaces %} 可能不适用于该存储库。 有关详细信息,请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#access-to-codespaces)”。 -### No access to create a codespace -{% data variables.product.prodname_github_codespaces %} is not available for all repositories. If the options for creating a codespace are not displayed, {% data variables.product.prodname_github_codespaces %} may not be available for that repository. For more information, see "[Creating a codespace for a repository](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#access-to-codespaces)." +如果个人帐户中每月剩余包含的 {% data variables.product.prodname_github_codespaces %} 使用量,或者设置了付款方式和支出限额,则将能够为公共存储库创建 codespaces。 但是,如果可以将更改推送到存储库,或者可以为存储库创建分支,则只能为专用存储库创建 codespace。 -Provided you have remaining monthly included usage of {% data variables.product.prodname_github_codespaces %} on your personal account, or you have set up a payment method and a spending limit, you will be able to create codespaces for public repositories. However, you can only create a codespace for a private repository if you can push changes to the repository, or you can fork the repository. +有关个人帐户包含的使用量和设置支出限制的详细信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)”和“[管理 {% data variables.product.prodname_github_codespaces %} 的支出限制](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-github-codespaces)”。 -For more information about included usage for personal accounts, and setting a spending limit, see "[About billing for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)" and "[Managing spending limits for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-github-codespaces)." +### 代码空间在创建时未打开 -### Codespace does not open when created +如果创建了代码空间,但未打开: -If you create a codespace and it does not open: +1. 如果出现缓存或报告问题,请尝试重新加载页面。 +2. 转到 {% data variables.product.prodname_github_codespaces %} 页面: https://github.com/codespaces ,检查新的 codespace 是否在此处列出。 该过程可能已成功创建代码空间,但未向浏览器报告。 如果列出了新的代码空间,则可以直接从该页打开它。 +3. 重试为存储库创建代码空间,以排除暂时性通信故障。 -1. Try reloading the page in case there was a caching or reporting problem. -2. Go to your {% data variables.product.prodname_github_codespaces %} page: https://github.com/codespaces and check whether the new codespace is listed there. The process may have successfully created the codespace but failed to report back to your browser. If the new codespace is listed, you can open it directly from that page. -3. Retry creating the codespace for the repository to rule out a transient communication failure. +如果仍然无法为其中 {% data variables.product.prodname_github_codespaces %} 可用的存储库创建 codespace,请 {% data reusables.codespaces.contact-support %} -If you still cannot create a codespace for a repository where {% data variables.product.prodname_github_codespaces %} is available, {% data reusables.codespaces.contact-support %} +### Codespace 创建失败 -### Codespace creation fails - -If the creation of a codespace fails, it's likely to be due to a temporary infrastructure issue in the cloud - for example, a problem provisioning a virtual machine for the codespace. A less common reason for failure is if it takes longer than an hour to build the container. In this case, the build is cancelled and codespace creation will fail. +如果创建 codespace 失败,则可能是由于云中的临时基础结构问题(例如,为 codespace 预配虚拟机时出现问题)。 失败的一个不太常见的原因是生成容器所需的时间超过一小时。 在这种情况下,将取消生成,并且 codespace 创建将失败。 {% note %} -**Note:** A codespace that was not successfully created is never going to be usable and should be deleted. For more information, see "[Deleting a codespace](/codespaces/developing-in-codespaces/deleting-a-codespace)." +注意:将永不使用未成功创建的 codespace,并应将其删除。 有关详细信息,请参阅“[删除 codespace](/codespaces/developing-in-codespaces/deleting-a-codespace)”。 {% endnote %} -If you create a codespace and the creation fails: +如果创建 codespace 但创建失败: -1. Check {% data variables.product.prodname_dotcom %}'s [Status page](https://githubstatus.com) for any active incidents. -1. Go to [your {% data variables.product.prodname_github_codespaces %} page](https://github.com/codespaces), delete the codespace, and create a new codespace. -1. If the container is building, look at the logs that are streaming and make sure the build is not stuck. A container build that takes longer than one hour will be canceled, resulting in a failed creation. +1. 检查 {% data variables.product.prodname_dotcom %} 的[“状态”页](https://githubstatus.com)是否有任何活动事件。 +1. 转到 [{% data variables.product.prodname_github_codespaces %} 页](https://github.com/codespaces),删除 codespace,然后创建新的 codespace。 +1. 如果容器正在生成,请查看正在流式传输的日志,并确保生成未停滞。 将取消花费超过一小时的容器生成,从而导致创建失败。 - One common scenario where this could happen is if you have a script running that is prompting for user input and waiting for an answer. If this is the case, remove the interactive prompt so that the build can complete non-interactively. + 发生这种情况的一种常见情况是,如果正在运行的脚本提示用户输入并等待答案。 如果是这种情况,请删除交互式提示,以便生成以非交互方式完成。 {% note %} - **Note**: To view the logs during a build: - * In the browser, click **View logs.** + 注意:若要在生成期间查看日志,请执行以下操作: + * 在浏览器中,单击“查看日志”。 - ![Screenshot of the Codespaces web UI with the View logs link emphasized](/assets/images/help/codespaces/web-ui-view-logs.png) + ![Codespaces Web UI 的屏幕截图,其中突出显示了“查看日志”链接](/assets/images/help/codespaces/web-ui-view-logs.png) - * In the VS Code desktop application, click **Building codespace** in the "Setting up remote connection" that's displayed. + * 在 VS Code 桌面应用程序中,单击显示的“设置远程链接”中的“生成 codespace”。 - ![Screenshot of VS Code with the Building codespace link emphasized](/assets/images/help/codespaces/vs-code-building-codespace.png) + ![VS Code 的屏幕截图,其中突出显示了“生成 codespace”链接](/assets/images/help/codespaces/vs-code-building-codespace.png) {% endnote %} -2. If you have a container that takes a long time to build, consider using prebuilds to speed up codespace creations. For more information, see "[Configuring prebuilds](/codespaces/prebuilding-your-codespaces/configuring-prebuilds#configuring-prebuilds)." +2. 如果容器需要很长时间才能生成,请考虑使用预生成来加快 codespace 创建速度。 有关详细信息,请参阅“[配置预生成](/codespaces/prebuilding-your-codespaces/configuring-prebuilds#configuring-prebuilds)”。 -## Deleting codespaces +## 删除代码空间 -A codespace can only be deleted by: -* The person who created the codespace. -* An organization owner for an organization-owned codespace. -* Automatic deletion at the end of a retention period. +codespace 只能通过以下方式删除: +* 创建 codespace 的人员。 +* 组织拥有的 codespace 的组织所有者。 +* 保留期结束时自动删除。 -For more information, see "[Deleting a codespace](/codespaces/developing-in-codespaces/deleting-a-codespace)" and "[Configuring automatic deletion of your codespaces](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces)." +有关详细信息,请参阅“[删除 codespace](/codespaces/developing-in-codespaces/deleting-a-codespace)”和“[配置 codespace 的自动删除](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces)”。 -## Container storage +## 容器存储 -When you create a codespace, it has a finite amount of storage and over time it may be necessary for you to free up space. Try running any of the following commands in the {% data variables.product.prodname_github_codespaces %} terminal to free up storage space. +创建代码空间时,存储量是有限的,随着时间的推移,可能需要释放空间。 尝试在 {% data variables.product.prodname_github_codespaces %} 终端中运行以下任一命令以释放存储空间。 -- Remove packages that are no longer used by using `sudo apt autoremove`. -- Clean the apt cache by using `sudo apt clean`. -- See the top 10 largest files in the codespace with`sudo find / -printf '%s %p\n'| sort -nr | head -10`. -- Delete unneeded files, such as build artifacts and logs. +- 使用 `sudo apt autoremove` 删除不再使用的包。 +- 使用 `sudo apt clean` 清理 apt 缓存. +- 使用 `sudo find / -printf '%s %p\n'| sort -nr | head -10` 查看 codespace 中前 10 个最大的文件。 +- 删除不需要的文件,如生成工件和日志。 -Some more destructive options: +一些更具破坏性的选项: -- Remove unused Docker images, networks, and containers by using `docker system prune` (append `-a` if you want to remove all images, and `--volumes` if you want to remove all volumes). -- Remove untracked files from working tree: `git clean -i`. +- 使用 `docker system prune`(如果要删除所有映像,请追加 `-a`;如果要删除所有卷,请追加 `--volumes`)删除不使用的 Docker 映像、网络和容器。 +- 从工作树中删除不跟踪的文件:`git clean -i`。 -## Configuration +## 配置 {% data reusables.codespaces.recovery-mode %} ``` This codespace is currently running in recovery mode due to a container error. ``` -Review the creation logs and update the dev container configuration as needed. For more information, see "[{% data variables.product.prodname_github_codespaces %} logs](/codespaces/troubleshooting/github-codespaces-logs)." +查看创建日志并根据需要更新开发容器配置。 有关详细信息,请参阅“[{% data variables.product.prodname_github_codespaces %} 日志](/codespaces/troubleshooting/github-codespaces-logs)”。 -You can then try restarting the codespace, or rebuilding the container. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#applying-configuration-changes-to-a-codespace)." +然后,可以尝试重启 codespace,或重新生成容器。 有关详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#applying-configuration-changes-to-a-codespace)”。 diff --git a/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-github-codespaces-clients.md b/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-github-codespaces-clients.md new file mode 100644 index 0000000000..44183112f4 --- /dev/null +++ b/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-github-codespaces-clients.md @@ -0,0 +1,118 @@ +--- +title: GitHub Codespaces 客户端故障排除 +shortTitle: Codespaces clients +intro: '本文提供有关在使用用于 {% data variables.product.prodname_github_codespaces %} 的客户端时可能遇到的问题的故障排除信息。' +miniTocMaxHeadingLevel: 3 +versions: + fpt: '*' + ghec: '*' +type: reference +topics: + - Codespaces +redirect_from: + - /codespaces/troubleshooting/troubleshooting-codespaces-clients +ms.openlocfilehash: 682160b3b92960487c0709fc411fc2143d18f415 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159435' +--- +{% jetbrains %} + +{% data reusables.codespaces.codespaces-jetbrains-beta-note %} + +{% endjetbrains %} + +{% webui %} + +## {% data variables.product.prodname_vscode %} Web 客户端故障排除 + +如果在非基于 Chromium 的浏览器中使用 {% data variables.product.prodname_github_codespaces %} 时遇到问题,请尝试切换到基于 Chromium 的浏览器,例如 Google Chrome 或 Microsoft Edge。 或者,在 [`microsoft/vscode`](https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen) 存储库中通过搜索标记有浏览器名称(如 [`firefox`](https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen+label%3Afirefox) 或 [`safari`](https://github.com/Microsoft/vscode/issues?q=is%3Aopen+is%3Aissue+label%3Asafari))的问题来检查浏览器是否存在已知问题。 + +如果在基于 Chromium 的浏览器中使用 {% data variables.product.prodname_github_codespaces %} 时遇到问题,可在 [`microsoft/vscode`](https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen) 存储库中检查是否遇到 {% data variables.product.prodname_vscode_shortname %} 的另一个已知问题。 + +### 与在本地使用 {% data variables.product.prodname_vscode_shortname %} 的差异 + +在浏览器中使用 {% data variables.product.prodname_vscode_shortname %} Web 客户端打开 codespace 时,你会注意到与在 {% data variables.product.prodname_vscode_shortname %} 桌面应用程序的本地工作区中工作有一些差异。 例如,某些键绑定将不同或丢失,并且某些扩展的行为可能不同。 有关摘要,请参阅 {% data variables.product.prodname_vscode_shortname %} 文档中的“[已知限制和调整](https://code.visualstudio.com/docs/remote/codespaces#_known-limitations-and-adaptations)”。 + +可使用 [`microsoft/vscode`](https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen+codespaces) 存储库中的 {% data variables.product.prodname_vscode_shortname %} 体验检查已知问题并记录新问题。 + +### {% data variables.product.prodname_vscode %} Insiders + +{% data variables.product.prodname_vscode %} Insiders 是 {% data variables.product.prodname_vscode_shortname %} 中最常见的版本。 它具有所有最新功能和错误修复,但偶尔也可能包含导致构建中断的新问题。 + +如果你使用的是 Insiders 版本并发现损坏的行为,我们建议切换到 {% data variables.product.prodname_vscode %} Stable 版,然后重试。 + +单击编辑器左下方的 {% octicon "gear" aria-label="The manage icon" %},然后选择“切换到稳定版本…”。如果 {% data variables.product.prodname_vscode_shortname %} Web 版本未加载或 {% octicon "gear" aria-label="The manage icon" %} 图标不可用,可将 `?vscodeChannel=stable` 追加到 codespace URL 并在该 URL 处加载 codespace 来强制切换到 {% data variables.product.prodname_vscode %} 稳定版。 + +如果在 {% data variables.product.prodname_vscode %} 稳定版中未修复此问题,请检查已知问题,如果需要,请在 [`microsoft/vscode`](https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen+codespaces) 存储库中记录 {% data variables.product.prodname_vscode_shortname %} 体验的新问题。 + +{% endwebui %} + +{% vscode %} + +## {% data variables.product.prodname_vscode_shortname %} 故障排除 + +在 {% data variables.product.prodname_vscode_shortname %} 桌面应用程序中打开 codespace 时,你可能会注意到与在本地工作区中工作相比存在一些差异,但体验应该相似。 + +如果遇到问题,可使用 [`microsoft/vscode`](https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen+codespaces) 存储库中的 {% data variables.product.prodname_vscode_shortname %} 体验检查已知问题并记录新问题。 + +### {% data variables.product.prodname_vscode %} Insiders + +{% data variables.product.prodname_vscode %} Insiders 是 {% data variables.product.prodname_vscode_shortname %} 中最常见的版本。 它具有所有最新功能和错误修复,但偶尔也可能包含导致构建中断的新问题。 + +如果你使用的是 Insiders 版本并发现损坏的行为,我们建议切换到 {% data variables.product.prodname_vscode %} Stable 版,然后重试。 + +若要切换到 {% data variables.product.prodname_vscode %} 稳定版,请关闭 {% data variables.product.prodname_vscode %} Insiders 应用程序,打开 {% data variables.product.prodname_vscode %} 稳定版应用程序,然后重新打开 codespace。 + +如果在 {% data variables.product.prodname_vscode %} 稳定版中未修复此问题,请检查已知问题,如果需要,请在 [`microsoft/vscode`](https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen+codespaces) 存储库中记录 {% data variables.product.prodname_vscode_shortname %} 体验的新问题。 + +{% endvscode %} + +{% jetbrains %} + +## JetBrains IDE 故障排除 + +### 性能问题 + +建议使用至少具有 4 个内核的 {% data variables.product.prodname_github_codespaces %} 计算机类型来运行任何 JetBrains IDE。 有关详细信息,请参阅“[更改 codespace 的计算机类型](/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace)”。 + +如果使用的是具有 4 个或更多内核的计算机,但是在 JetBrains 中体验到的性能感觉有点缓慢,则可能需要增加最大 Java 堆大小。 + +建议将最大堆大小设置为 2862 MiB (3 GB) 和远程主机 RAM 的 60% 之间。 + +下面提供了一些指导作为初始起点,你可以根据代码库的大小和运行应用程序所需的内存进行调整。 例如,如果你有一个大型或复杂的代码库,则可能需要进一步增加堆大小。 如果应用程序较大,则可以设置较小的堆大小,以允许应用程序获得更多内存。 + +| 计算机类型 | 最大堆大小 | +| -------------- | ----------------- | +| 4 个内核 | 3 GB | +| 8 个内核 | 4 GB | +| 16 或 32 个内核 | 8 GB | + +1. 在应用程序窗口顶部的导航栏左侧,单击 codespace 的名称。 + + ![JetBrains 中“资源”按钮的屏幕截图](/assets/images/help/codespaces/jetbrains-resources-button.png) + +1. 在“性能”选项卡中,注意 CPU 负载和内存详细信息。 这些值将指示计算机是否重载。 + + ![JetBrains 中“Localhost”按钮的屏幕截图](/assets/images/help/codespaces/jetbrains-performance.png) + +1. 单击“设置”选项卡并编辑堆大小,将其增加到不超过 codespace 可用内存的 60%。 + + ![最大堆大小设置的屏幕截图](/assets/images/help/codespaces/jetbrains-heap-setting.png) + +1. 单击“保存并重启”。 + +### SSH 连接问题 + +若要通过在 codespace 中运行的 SSH 服务器进行连接,必须在 `~/.ssh` 目录(MacOS 和 Linux)或 `%HOMEPATH%\.ssh` 目录 (Windows) 中具有已添加到 {% data variables.product.prodname_dotcom %} 帐户的 SSH 密钥。 如果此目录中没有任何密钥,{% data variables.product.prodname_cli %} 将生成密钥。 有关详细信息,请参阅“[将新的 SSH 密钥添加到 {% data variables.product.prodname_dotcom %} 帐户](/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account?platform=windows&tool=webui)”。 + +如果遇到密钥验证问题,请尝试升级 {% data variables.product.prodname_cli %} 的版本。 有关信息,请参阅 {% data variables.product.prodname_cli %} 的自述文件中的[升级说明](https://github.com/cli/cli#installation)。 + +### JetBrains IDE 问题 + +有关你正在使用的 JetBrains IDE 或 JetBrains 网关应用程序特定问题的帮助,请参阅 JetBrains 网站上的“[产品支持](https://www.jetbrains.com/support/)”。 + +{% endjetbrains %} + diff --git a/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-gpg-verification-for-github-codespaces.md b/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-gpg-verification-for-github-codespaces.md new file mode 100644 index 0000000000..c6f454a2f8 --- /dev/null +++ b/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-gpg-verification-for-github-codespaces.md @@ -0,0 +1,117 @@ +--- +title: 排查 GitHub Codespaces 的 GPG 验证问题 +shortTitle: GPG verification +intro: 本文提供在 codespace 中对提交进行签名的相关错误的故障排除建议。 +versions: + fpt: '*' + ghec: '*' +type: reference +topics: + - Codespaces +ms.openlocfilehash: f3a6537d1ee9087803054347689591c2b217e42e +ms.sourcegitcommit: 47e03737d09bed84dfedb7be5924d893d34ea1a8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/16/2022 +ms.locfileid: '148167111' +--- +如果启用 GPG 验证,{% data variables.product.prodname_github_codespaces %} 会自动在从所选存储库创建的 codespace 中对提交进行签名。 有关详细信息,请参阅“[管理 {% data variables.product.prodname_github_codespaces %} 的 GPG 验证](/codespaces/managing-your-codespaces/managing-gpg-verification-for-github-codespaces)”。 + +{% data reusables.codespaces.gpg-in-active-codespaces %} + +如果 {% data variables.product.prodname_github_codespaces %} 未能对提交进行签名,你可能会看到如下所示的错误。 + +```Shell +$ git commit -m 'Initial commit' +error: gpg failed to sign the data +fatal: failed to write commit object +``` + +在以下情况下,你可能会遇到此错误: + +- 你已禁用 GPG 验证,并且正在尝试在现有 codespace 中进行常规的未签名提交。 +- 你已启用 GPG 验证,但重写了 {% data variables.product.prodname_github_codespaces %} 对提交进行签名所需的 Git 配置,例如,将 {% data variables.product.prodname_github_codespaces %} 链接到包含 Git 配置文件的点文件存储库。 + +## 禁用 GPG 验证后的错误 + +启用 GPG 验证后,{% data variables.product.prodname_github_codespaces %} 默认对你在 codespace 中所做的所有提交进行签名。 它执行此操作的方法是将 `commit.gpgsign` Git 配置值设置为 `true`。 + +如果已禁用 GPG 验证,并且正在使用现有 codespace,则此值仍将设置为 `true`。 这意味着 {% data variables.product.prodname_github_codespaces %} 将尝试对提交进行签名,但无法这样做,因为你已禁用 GPG 验证设置。 + +要在 codespace 中继续进行常规的未签名提交,请在终端中输入以下命令将 `commit.gpgsign` 重置为默认值 `false`。 + +```Shell{:copy} +git config --unset commit.gpgsign +``` + +要检查是否已从配置中正确删除该值,可输入 `git config --list`。 列表中不应出现 `commit.gpgsign` 的值。 + +## 冲突的配置引发的错误 + +要自动对提交进行签名,{% data variables.product.prodname_github_codespaces %} 会在 codespace 中设置某些 Git 配置值。 如果重写 {% data variables.product.prodname_github_codespaces %} 设置的值,则可能无法对提交进行签名。 + +如果已将 {% data variables.product.prodname_github_codespaces %} 链接到包含 Git 配置文件的点文件存储库,则可能无意中重写了这些值。 有关将点文件与 {% data variables.product.prodname_github_codespaces %} 配合使用的详细信息,请参阅“[为帐户设置个性化的 {% data variables.product.prodname_github_codespaces %}](/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account#dotfiles)”。 + +### 检查是否存在冲突的配置 + +要使用 GPG 对提交进行签名,{% data variables.product.prodname_github_codespaces %} 会自动在系统级别设置以下 Git 配置值。 + +| 配置设置 | 所需的值 | +| --------------------- | -------------- | +| `user.name` | 必须与 {% data variables.product.prodname_dotcom %} 配置文件上设置的全名匹配 | +| `credential.helper` | 必须设置为 `/.codespaces/bin/gitcredential_github.sh` | +| `gpg.program` | 必须设置为 `/.codespaces/bin/gh-gpgsign` | + +要检查是否在 codespace 中正确设置了这些值,可使用 `git config --list --show-origin` 命令。 由于 {% data variables.product.prodname_github_codespaces %} 在系统级别设置此配置,因此所需的配置设置应来自 `/usr/local/etc/gitconfig`。 + +```Shell +$ git config --list --show-origin +file:/usr/local/etc/gitconfig credential.helper=/.codespaces/bin/gitcredential_github.sh +file:/usr/local/etc/gitconfig user.name=Mona Lisa +file:/usr/local/etc/gitconfig gpg.program=/.codespaces/bin/gh-gpgsign +``` + +除了上面列出的值之外,如果 codespace 中使用的点文件包含以下任何值,你可能会遇到错误。 + +- `user.signingkey` Git 配置值 +- `commit.gpgsign` Git 配置值 +- 手动设置的 `GITHUB_TOKEN` + +### 删除冲突的配置 + +如果要为 {% data variables.product.prodname_github_codespaces %} 启用自动 GPG 验证,则需要从 codespace 中使用的点文件中删除所有冲突的配置。 + +例如,如果本地计算机上的全局 `.gitconfig` 文件包含 `gpg.program` 值,并且你已将此文件推送到与 {% data variables.product.prodname_github_codespaces %} 链接的点文件存储库,则可能需要从此文件中删除 `gpg.program`,并改为在本地计算机上的系统级别对其进行设置。 + +{% note %} + +注意:对点文件存储库所做的任何更改都将应用于你创建的新 codespace,但不会应用于现有的 codespace。 + +{% endnote %} + +1. 在本地计算机上打开终端。 +2. 要从 `~/.gitconfig` (Mac/Linux) 或 `C:\Users\YOUR-USER\.gitconfig` (Windows) 中删除冲突的值,请使用 `git config --global --unset` 命令。 + + ```Shell + $ git config --global --unset gpg.program + ``` +3. 将更改推送到 {% data variables.product.prodname_dotcom %} 上的点文件存储库。 +4. (可选)要保留本地配置,可以在 Git 配置文件中再次设置该值,但不将此设置推送到点文件存储库。 + + 例如,可使用 `--system` 标志在 `PATH/etc/gitconfig` 中的系统级文件中设置配置,其中 `PATH` 是在系统上安装 Git 的目录。 + + ```Shell + $ git config --system gpg.program gpg2 + ``` + +或者,如果点文件存储库在识别的文件(如 `install.sh`)中包含安装脚本,你可使用 `$CODESPACES` 环境变量添加条件逻辑,例如仅当你不在 codespace 中时设置 `gpg.program`。 在下面的示例中,如果你不在 codespace 中,`-z "$CODESPACES"` 返回 `true`。 + +```Shell{:copy} +if [ -z "$CODESPACES" ]; then + git config --global gpg.program gpg2 +fi +``` + +## 延伸阅读 +- “[关于提交签名验证](/authentication/managing-commit-signature-verification/about-commit-signature-verification)” +- 官方 Git 文档中的 [`git config`](https://git-scm.com/docs/git-config) diff --git a/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-port-forwarding-for-github-codespaces.md b/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-port-forwarding-for-github-codespaces.md index 2264e6432e..3ee5dd45b2 100644 --- a/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-port-forwarding-for-github-codespaces.md +++ b/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-port-forwarding-for-github-codespaces.md @@ -1,6 +1,6 @@ --- -title: Troubleshooting port forwarding for GitHub Codespaces -intro: Troubleshooting steps for common port forwarding issues. +title: GitHub Codespaces 的端口转发疑难解答 +intro: 常见端口转发问题的疑难解答步骤。 versions: fpt: '*' ghec: '*' @@ -10,17 +10,22 @@ topics: shortTitle: Port forwarding redirect_from: - /codespaces/troubleshooting/troubleshooting-port-forwarding-for-codespaces +ms.openlocfilehash: 828150ca05c18cb1106f5a3c883331785b6bce2e +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159147' --- +在 codespace 内运行的应用程序向控制台输出端口时,{% data variables.product.prodname_github_codespaces %} 将检测到 localhost URL 模式并自动转发端口。 有关详细信息,请参阅“[在 codespace 中转发端口](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)”。 -When an application running inside a codespace outputs a port to the console, {% data variables.product.prodname_github_codespaces %} detects the localhost URL pattern and automatically forwards the port. For more information, see "[Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)." +如果端口未自动转发,则可以手动转发该端口。 有关详细信息,请参阅“[转发端口](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace#forwarding-a-port)”。 -If a port is not automatically forwarded, you can forward it manually. For more information, see "[Forwarding a port](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace#forwarding-a-port)." +如果设置了端口转发,请检查以下各项: -If port forwarding is set up, check the following: +- 使用 {% data variables.product.prodname_vscode_shortname %} 右下角弹出的通知“toast”消息中的链接,或单击终端中的 URL 打开转发端口。 如果通过浏览器连接到 codespace,则在本地计算机上键入 `localhost:8000`(作为示例)将不起作用。 +- 确保检查应用程序是否仍在代码空间中运行。 如果代码空间在一段时间不活动后停止,则需要确保在代码空间重新启动后重新启动应用程序。 -- Use the link in the notification "toast" message, that pops up in the bottom right corner of {% data variables.product.prodname_vscode_shortname %}, or click the URL in Terminal, to open the forwarded port. Typing in `localhost:8000` (as an example) to your local machine will not work if you're connected to the codespace via the browser. -- Make sure to check that your application is still running from within your codespace. If your codespace has stopped after a period of inactivity, you'll need to ensure to restart your application once the codespace has restarted. - -Typically, you can make a forwarded port accessible publicly, or within the organization that owns a repository. For more information, see "[Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)." If either, or both, of the options for public or organization visibility are not available, this indicates that an organization-level policy has been configured. For more information, see "[Restricting the visibility of forwarded ports](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)." +通常,可使转发端口可公开访问,也可在拥有存储库的组织内访问。 有关详细信息,请参阅“[在 codespace 中转发端口](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)”。 如果公共或组织可见性选项中的任何一个或两者都不可用,则表示已配置了组织级别的策略。 有关详细信息,请参阅“[限制转发端口的可见性](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)”。 {% data reusables.codespaces.forwarded-ports-environment-variable %} diff --git a/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-your-connection-to-github-codespaces.md b/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-your-connection-to-github-codespaces.md index c403cf9f6c..bab3b0551c 100644 --- a/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-your-connection-to-github-codespaces.md +++ b/translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-your-connection-to-github-codespaces.md @@ -1,6 +1,6 @@ --- -title: Troubleshooting your connection to GitHub Codespaces -intro: 'Troubleshooting help for connecting to {% data variables.product.prodname_github_codespaces %}.' +title: GitHub Codespaces 连接疑难解答 +intro: '有关连接到 {% data variables.product.prodname_github_codespaces %} 的疑难解答帮助。' versions: fpt: '*' ghec: '*' @@ -10,49 +10,54 @@ topics: shortTitle: Connection redirect_from: - /codespaces/troubleshooting/troubleshooting-your-connection-to-codespaces +ms.openlocfilehash: 75632e73b689ed7fe1df95027f6e5170136c7935 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159477' --- +## 503 代码空间服务不可用 -## 503 codespace service unavailable +Codespaces 设置为在无任何活动 30 分钟后停止。 如果你在 codespace 停止后尝试与其交互,你可能会看到 `503 service unavailable` 错误。 -Codespaces are set to stop after 30 minutes without any activity. If you try to interact with a codespace after it has stopped, you may see a `503 service unavailable` error. +- 如果 {% data variables.product.prodname_vscode %} 或浏览器窗口中显示“开始”按钮,请单击“开始”以重新连接到 codespace 。 +- 通过重新加载窗口来重置代码空间。 从 {% data variables.product.prodname_vscode %} 中的[命令面板](/codespaces/codespaces-reference/using-the-command-palette-in-codespaces#accessing-the-command-palette),单击“开发人员: 重新加载窗口”。 -- If a **Start** button is shown in {% data variables.product.prodname_vscode %} or in your browser window, click **Start** to reconnect to the codespace. -- Reset your codespace by reloading the window. From the [Command Palette](/codespaces/codespaces-reference/using-the-command-palette-in-codespaces#accessing-the-command-palette) in {% data variables.product.prodname_vscode %}, click **Developer: Reload Window**. +## 浏览器无法连接 -## Browser cannot connect +有时,您可能无法从浏览器访问代码空间。 如果发生这种情况,请转到 https://github.com/codespaces 并尝试从该页面连接到 codespace。 -Sometimes you may not be able to access a codespace from your browser. If this happens, go to https://github.com/codespaces and try connecting to the codespace from that page. + - 如果该页面上未列出代码空间,请检查您是尝试连接到的代码空间的所有者。 您只能打开自己创建的代码空间。 代码空间的 URL 始终包含 {% data variables.product.company_short %} 句柄。 + - 如果列出了代码空间,但您无法从该页面进行连接,请检查是否可以使用其他浏览器进行连接。 - - If the codespace is not listed on that page, check that you are the owner of the codespace you are trying to connect to. You can only open a codespace that you created. The URLs for your codespaces always include your {% data variables.product.company_short %} handle. - - If the codespace is listed but you cannot connect from that page, check whether you can connect using a different browser. +您的公司网络可能阻止连接。 如果可能,请检查设备上是否有任何被拒绝的连接的日志记录。 -Your company network may be blocking the connection. If possible, check any logging for rejected connections on your device. +如果仍然无法连接,{% data reusables.codespaces.contact-support %} -If you still cannot connect, {% data reusables.codespaces.contact-support %} +## 无法连接到 JupyterLab 中的 codespace -## Unable to connect to your codespace in JupyterLab +若要在 JupyterLab 中使用 codespace,必须确保 codespace 已安装 JupyterLab。 {% data variables.product.prodname_github_codespaces %} 使用的默认容器映像包括 JupyterLab,但如果已自定义开发容器配置,则必须手动安装 JupyterLab。 -To be able to use a codespace in JupyterLab, you must ensure that your codespace has it installed. The default container image that's used by {% data variables.product.prodname_github_codespaces %} includes JupyterLab, but if you have customized your dev container configuration you will have to manually install JupyterLab. +如果 codespace 使用基于 Debian 的映像,则可以将 `python` 功能添加到 `devcontainer.json` 文件,并将 `installJupyterlab` 选项设置为 `true`,从而在开发容器中安装 JupyterLab。 否则,请直接将其安装在 Dockerfile 中。 有关安装说明,请参阅 JupyterLab 文档中的“[安装](https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html)”。 -If your codespace uses a Debian-based image, you can install JupyterLab in the dev container by adding the `python` feature to your `devcontainer.json` file, with the `installJupyterlab` option set to `true`. Otherwise, install it directly in your Dockerfile. For installation instructions, see "[Installation](https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html)" in the JupyterLab documentation. +有关 `python` 功能的详细信息,请参阅[`devcontainers/features` 存储库](https://github.com/devcontainers/features/tree/main/src/python)中的自述文件页。 有关 `devcontainer.json` 文件以及 Dockerfile 的详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#devcontainerjson)”。 -For more information about the `python` feature, see the README page in the [`devcontainers/features` repository](https://github.com/devcontainers/features/tree/main/src/python). For more information about the `devcontainer.json` file and the Dockerfile, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#devcontainerjson)." +如果仍然无法连接,{% data reusables.codespaces.contact-support %} -If you still cannot connect, {% data reusables.codespaces.contact-support %} +## {% data variables.product.prodname_vscode %} 的 {% data variables.product.prodname_github_codespaces %} 扩展无法连接 -## {% data variables.product.prodname_github_codespaces %} extension for {% data variables.product.prodname_vscode %} cannot connect +如果无法从 {% data variables.product.prodname_vscode %} 桌面连接到代码空间,请使用以下故障排除步骤。 -If you cannot connect to a codespace from {% data variables.product.prodname_vscode %} desktop, use the following troubleshooting steps. +1. 检查您是否安装了最新版本的 {% data variables.product.prodname_github_codespaces %} 扩展。 该扩展是预览版,并且频繁发布更新。 + 1. 在 {% data variables.product.prodname_vscode %} 中,显示“Extensions(扩展)”选项卡。 + 2. 选择 {% data variables.product.prodname_github_codespaces %} 扩展以显示扩展的概述页面。 + 3. 如果有可用更新,则会显示一个按钮,单击“更新到 X.X.X”以升级到最新版本。 +2. 检查你使用的是 {% data variables.product.prodname_vscode %} 稳定版本还是 [{% data variables.product.prodname_vscode %} 预览体验成员](https://code.visualstudio.com/insiders/)版本(每晚更新)。 如果使用的是预览体验成员版本,请尝试安装[稳定版本](https://code.visualstudio.com/)。 +3. 您的公司网络可能阻止连接。 如果可能,请检查设备上是否有任何被拒绝的连接的日志记录。 -1. Check that you have the latest version of the {% data variables.product.prodname_github_codespaces %} extension installed. The extension is a preview release and frequent updates are released. - 1. In {% data variables.product.prodname_vscode %}, display the "Extensions" tab. - 2. Select the {% data variables.product.prodname_github_codespaces %} extension to display the extension's overview page. - 3. If an update is available, a button is shown, click **Update to X.X.X** to upgrade to the latest version. -2. Check whether you are using the stable build of {% data variables.product.prodname_vscode %} or the [{% data variables.product.prodname_vscode %} Insiders](https://code.visualstudio.com/insiders/) release (nightly updates). If you are using the insiders release, try installing the [stable build](https://code.visualstudio.com/). -3. Your company network may be blocking the connection. If possible, check any logging for rejected connections on your device. +如果仍然无法连接,{% data reusables.codespaces.contact-support %} -If you still cannot connect, {% data reusables.codespaces.contact-support %} +### 代码空间存在延迟问题 -### The codespace has latency issues - -If the codespace seems particularly slow or has latency issues, it is possible that it has been created in a region that is far from you. To resolve this, you can [manually set your {% data variables.product.prodname_github_codespaces %} region](/codespaces/managing-your-codespaces/setting-your-default-region-for-codespaces). +如果代码空间看起来特别慢或存在延迟问题,则可能是在远离您的区域中创建的。 要解决此问题,可以[手动设置 {% data variables.product.prodname_github_codespaces %} 区域](/codespaces/managing-your-codespaces/setting-your-default-region-for-codespaces)。 diff --git a/translations/zh-CN/content/codespaces/troubleshooting/working-with-support-for-github-codespaces.md b/translations/zh-CN/content/codespaces/troubleshooting/working-with-support-for-github-codespaces.md index c75eb6ab59..379831a5b3 100644 --- a/translations/zh-CN/content/codespaces/troubleshooting/working-with-support-for-github-codespaces.md +++ b/translations/zh-CN/content/codespaces/troubleshooting/working-with-support-for-github-codespaces.md @@ -1,6 +1,6 @@ --- -title: Working with support for GitHub Codespaces -intro: 'Tips on getting the best help from support for {% data variables.product.prodname_github_codespaces %}.' +title: 使用对 GitHub Codespaces 的支持 +intro: '有关从 {% data variables.product.prodname_github_codespaces %} 的支持中获得最佳帮助的提示。' versions: fpt: '*' ghec: '*' @@ -10,29 +10,34 @@ topics: shortTitle: Working with support redirect_from: - /codespaces/troubleshooting/working-with-support-for-codespaces +ms.openlocfilehash: a4db589cb5d8de71e6e8c7d109e0156885c33848 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159434' --- +在支持人员帮助你解决 codespace 问题之前,你需要知道 codespace 的永久名称及其 codespace ID(标识符)。 此外,支持人员可能会要求您与他们共享一些日志。 有关详细信息,请参阅“[{% data variables.product.prodname_github_codespaces %} 日志](/codespaces/troubleshooting/github-codespaces-logs)”和“[关于 GitHub 支持](/github/working-with-github-support/about-github-support)”。 -Before support can help you with problems with codespaces, you need to know the permanent name of the codespace and its codespaces ID (identifier). In addition, support may ask you to share some logs with them. For more information, see "[{% data variables.product.prodname_github_codespaces %} logs](/codespaces/troubleshooting/github-codespaces-logs)" and "[About GitHub Support](/github/working-with-github-support/about-github-support)." +## 代码空间名称 -## Codespace names +每个 codespace 都有一个唯一的名称,该名称是 {% data variables.product.company_short %} 句柄、两三个自动生成的单词和一些随机字符的组合。 例如:`octocat-literate-space-parakeet-mld5`。 两个或三个自动生成的单词也构成了 codespace 的初始显示名称,在本例中为 `literate-space-parakeet`。 可以更改 codespace 的显示名称,但这不会影响永久名称。 有关详细信息,请参阅“[重命名 codespace](/codespaces/customizing-your-codespace/renaming-a-codespace)”。 -Each codespace has a unique name that is a combination of your {% data variables.product.company_short %} handle, two or three automatically generated words, and some random characters. For example: `octocat-literate-space-parakeet-mld5`. The two or three automatically generated words also form the initial display name of your codespace, in this case, `literate-space-parakeet`. You can change the display name for a codespace, but this will not affect the permanent name. For more information, see "[Renaming a codespace](/codespaces/customizing-your-codespace/renaming-a-codespace)." +要查找代码空间的名称: -To find the name of a codespace: +- 在浏览器中打开代码空间。 URL 的子域是代码空间的名称。 例如:`https://octocat-literate-space-parakeet-mld5.github.dev` 是 `octocat-literate-space-parakeet-mld5` codespace 的 URL。 +- 如果无法打开 codespace,可以在 https://github.com/codespaces 上访问 {% data variables.product.product_name %} 中的名称。 将鼠标悬停在 https://github.com/codespaces 上的 codespace 的显示名称上时,该名称将在弹出项中显示。 + ![将鼠标悬停在上方时显示的 codespace 名称](/assets/images/help/codespaces/find-codespace-name-github.png) -- Open the codespace in the browser. The subdomain of the URL is the name of the codespace. For example: `https://octocat-literate-space-parakeet-mld5.github.dev` is the URL for the `octocat-literate-space-parakeet-mld5` codespace. -- If you cannot open a codespace, you can access the name in {% data variables.product.product_name %} on https://github.com/codespaces. The name is shown in a pop-up when you hover over the display name of a codespace on https://github.com/codespaces. - ![Codespace name shown on hover over](/assets/images/help/codespaces/find-codespace-name-github.png) +代码空间的名称也包含在许多日志文件中。 例如,在 codespace 日志中是作为 `friendlyName` 的值;在 {% data variables.product.prodname_github_codespaces %} 扩展日志中,是位于 `making GET request for` 之后;在浏览器控制台日志中,是位于 `clientUrl` 之后。 有关详细信息,请参阅“[{% data variables.product.prodname_github_codespaces %} 日志](/codespaces/troubleshooting/github-codespaces-logs)”。 -The name the codespace is also included in many of the log files. For example, in the codespace logs as the value of `friendlyName`, in the {% data variables.product.prodname_github_codespaces %} extension log after `making GET request for`, and in the browser console log after `clientUrl`. For more information, see "[{% data variables.product.prodname_github_codespaces %} logs](/codespaces/troubleshooting/github-codespaces-logs)." +## 代码空间 ID -## Codespaces IDs +每个代码空间还有一个 ID(标识符)。 默认情况下,这在 {% data variables.product.prodname_vscode %} 中不显示,因此您可能需要先更新 {% data variables.product.prodname_github_codespaces %} 扩展的设置,然后才能访问该 ID。 -Every codespace also has an ID (identifier). This is not shown by default in {% data variables.product.prodname_vscode %} so you may need to update the settings for the {% data variables.product.prodname_github_codespaces %} extension before you can access the ID. - -1. In {% data variables.product.prodname_vscode %}, browser or desktop, in the Activity Bar on the left, click **Remote Explorer** to show details for the codespace. +1. 在 {% data variables.product.prodname_vscode %}、浏览器或桌面中的左侧活动栏中,单击“远程资源管理器”以显示 codespace 的详细信息。 {% indented_data_reference reusables.codespaces.remote-explorer spaces=3 %} -1. If the sidebar includes a "Codespace Performance" section, hover over the "Codespace ID" and click the clipboard icon to copy the ID. -1. If the information is not shown, click {% octicon "gear" aria-label="The gear icon" %}, in the bottom-left corner of the Activity Bar, to display the "Settings" tab. -1. Expand **Extensions** and click **{% data variables.product.prodname_github_codespaces %}** to display the settings for the extension. Then enable **Show Performance Explorer** to display the "Codespace Performance" section in the sidebar. - ![Codespace ID and settings required to display performance information](/assets/images/help/codespaces/find-codespace-id.png) +1. 如果侧边栏包含“Codespace Performance(代码空间性能)”部分,请将鼠标悬停在“Codespace ID(代码空间 ID)”上,然后单击剪贴板图标以复制 ID。 +1. 如果未显示信息,请单击活动栏左下角的 {% octicon "gear" aria-label="The gear icon" %} 以显示“Settings(设置)”选项卡。 +1. 展开“扩展”,然后单击“{% data variables.product.prodname_github_codespaces %}”以显示扩展的设置 。 然后启用“显示性能资源管理器”,在边栏中显示“codespace 性能”部分。 + ![显示性能信息所需的 codespace ID 和设置](/assets/images/help/codespaces/find-codespace-id.png) diff --git a/translations/zh-CN/content/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-students/about-github-global-campus-for-students.md b/translations/zh-CN/content/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-students/about-github-global-campus-for-students.md index d7164d372a..396124b041 100644 --- a/translations/zh-CN/content/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-students/about-github-global-campus-for-students.md +++ b/translations/zh-CN/content/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-students/about-github-global-campus-for-students.md @@ -1,6 +1,6 @@ --- -title: About GitHub Global Campus for students -intro: '{% data variables.product.prodname_education %} offers students real-world experience with free access to various developer tools from {% data variables.product.prodname_dotcom %}''s partners.' +title: 关于学生版 GitHub Global Campus +intro: '{% data variables.product.prodname_education %} 让学生免费使用 {% data variables.product.prodname_dotcom %} 合作伙伴的各种开发工具,为他们提供真实的体验。' redirect_from: - /education/teach-and-learn-with-github-education/about-github-education-for-students - /github/teaching-and-learning-with-github-education/about-github-education-for-students @@ -10,40 +10,46 @@ redirect_from: versions: fpt: '*' shortTitle: For students +ms.openlocfilehash: 198f0354e63721a4763e8fa32f832a19b2dac9d9 +ms.sourcegitcommit: 3abdbdbb47a9319f20e11845e9c2d8a7fce63422 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/15/2022 +ms.locfileid: '148165095' --- -Using {% data variables.product.prodname_dotcom %} for your school projects is a practical way to collaborate with others and build a portfolio that showcases real-world experience. +将 {% data variables.product.prodname_dotcom %} 用于学校项目是一种与别人协作的实用方式,可创建展示真实世界的作品集。 -Everyone with a {% data variables.product.prodname_dotcom %} account can collaborate in unlimited public and private repositories with {% data variables.product.prodname_free_user %}. As a student, you can also apply for {% data variables.product.prodname_education %} student benefits. Your {% data variables.product.prodname_education %} student benefits and resources are all included in {% data variables.product.prodname_global_campus %}, a portal that allows you to access your education benefits, all in one place. For more information, see "[Apply to GitHub Global Campus as a student](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-students/apply-to-github-global-campus-as-a-student)" and [{% data variables.product.prodname_education %}](https://education.github.com/). +拥有 {% data variables.product.prodname_dotcom %} 帐户的每个人都可通过 {% data variables.product.prodname_free_user %} 在无限的公共和私有仓库中协作。 作为学生,还可以申请 {% data variables.product.prodname_education %} 学生权益。 {% data variables.product.prodname_education %} 学生权益和资源均包含在 {% data variables.product.prodname_global_campus %} 中,这是一个可访问教育权益的一站式门户。 有关详细信息,请参阅“[以学生身份申请加入 GitHub Global Campus](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-students/apply-to-github-global-campus-as-a-student)”和 [{% data variables.product.prodname_education %}](https://education.github.com/)。 -Before applying for Global Campus, check if your learning community is already partnered with us as a {% data variables.product.prodname_campus_program %} school. For more information, see "[About {% data variables.product.prodname_campus_program %}](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/about-github-campus-program)." +在申请 Global Campus 之前,请检查你的学习社区是否已作为 {% data variables.product.prodname_campus_program %} 学校与我们合作。 有关详细信息,请参阅“[关于 {% data variables.product.prodname_campus_program %}](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/about-github-campus-program)”。 -If you're a member of a school club, a teacher can apply for {% data variables.product.prodname_global_campus %} so your team can collaborate using {% data variables.product.prodname_team %}, which allows unlimited users and private repositories, for free. For more information, see "[Apply to {% data variables.product.prodname_global_campus %} as a teacher](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-teachers/apply-to-github-global-campus-as-a-teacher)." +如果你是学校俱乐部的成员,教师可以申请 {% data variables.product.prodname_global_campus %},这样你的团队可以免费使用 {% data variables.product.prodname_team %}(允许无限的用户和专用存储库)进行协作。 有关详细信息,请参阅“[以教师身份申请加入 {% data variables.product.prodname_global_campus %}](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-teachers/apply-to-github-global-campus-as-a-teacher)”。 -Once you are a verified {% data variables.product.prodname_global_campus %} student, you can access {% data variables.product.prodname_global_campus %} anytime by going to the [{% data variables.product.prodname_education %} website](https://education.github.com). +当你成为经过验证的 {% data variables.product.prodname_global_campus %} 学生后,可随时转到 [{% data variables.product.prodname_education %} 网站](https://education.github.com)来访问 {% data variables.product.prodname_global_campus %}。 -![{% data variables.product.prodname_global_campus %} portal for students](/assets/images/help/education/global-campus-portal-students.png) +![学生版 {% data variables.product.prodname_global_campus %} 门户](/assets/images/help/education/global-campus-portal-students.png) -## {% data variables.product.prodname_global_campus %} features for students +## 学生版 {% data variables.product.prodname_global_campus %} 功能 -{% data variables.product.prodname_global_campus %} is a portal from which you can access your {% data variables.product.prodname_education %} benefits and resources, all in one place. On the {% data variables.product.prodname_global_campus %} portal, students can: -- Connect with a local Campus Expert. For more information on campus experts, see "[About Campus Experts](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/use-github-at-your-educational-institution/about-campus-experts)." -- Explore and claim offers for free industry tools from the [Student Developer Pack](https://education.github.com/pack). -- See upcoming in-person and virtual events for students, curated by {% data variables.product.prodname_education %} and student leaders. -- View assignments from [GitHub Classroom](https://classroom.github.com/) with upcoming due dates. -- Stay in the know on what the community is interested in by rewatching recent [Campus TV](https://www.twitch.tv/githubeducation) episodes. Campus TV is created by {% data variables.product.prodname_dotcom %} and student community leaders and can be watched live or on demand. -- Discover student-created repositories from GitHub Community Exchange. For more information, see "[About GitHub Community Exchange](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-students/about-github-community-exchange)." +{% data variables.product.prodname_global_campus %} 是一个一站式门户,你可从中访问 {% data variables.product.prodname_education %} 权益和资源。 在 {% data variables.product.prodname_global_campus %} 门户上,学生可以执行以下操作: +- 与本地校园专家联系。 有关校园专家的详细信息,请参阅“[关于校园专家](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/use-github-at-your-educational-institution/about-campus-experts)”。 +- 探索并申请[学生开发人员包](https://education.github.com/pack)中免费行业工具的优惠。 +- 查看由 {% data variables.product.prodname_education %} 和学生领袖策划的现场活动和虚拟活动。 +- 查看 [GitHub Classroom](https://classroom.github.com/) 中临近截止日期的作业。 +- 重新观看最近的 [Campus TV](https://www.twitch.tv/githubeducation) 剧集,了解社区对什么感兴趣。 Campus TV 由 {% data variables.product.prodname_dotcom %} 和学生社区领袖创建,可观看直播或按需观看。 +- 从 GitHub Community Exchange 发现学生创建的存储库。 有关详细信息,请参阅“[关于 GitHub Community Exchange](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-students/about-github-community-exchange)”。 -{% data variables.product.prodname_global_campus %} students also receive the following {% data variables.product.prodname_dotcom %} benefits. -- **{% data variables.product.prodname_copilot %}**: Verified students receive a free subscription for {% data variables.product.prodname_copilot %}. You will be automatically notified about the free subscription when you visit the {% data variables.product.prodname_copilot %} subscription page in your account settings. For more information about subscribing to and using {% data variables.product.prodname_copilot %}, see "[Managing your {% data variables.product.prodname_copilot %} subscription](/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription#setting-up-a-trial-of-github-copilot)" and "[About {% data variables.product.prodname_copilot %}](/copilot/overview-of-github-copilot/about-github-copilot)." -- **{% data variables.product.prodname_github_codespaces %}**: {% data reusables.education.student-codespaces-benefit %} For more information on getting started with {% data variables.product.prodname_github_codespaces %}, see "[{% data variables.product.prodname_github_codespaces %} overview](/codespaces/overview)." +{% data variables.product.prodname_global_campus %} 学生还可获得以下 {% data variables.product.prodname_dotcom %} 权益。 +- **{% data variables.product.prodname_copilot %}** :通过验证的学生可免费订阅 {% data variables.product.prodname_copilot %}。 在帐户设置中访问 {% data variables.product.prodname_copilot %} 订阅页时,将自动收到有关免费订阅的通知。 有关订阅和使用 {% data variables.product.prodname_copilot %} 的详细信息,请参阅“[管理 {% data variables.product.prodname_copilot %} 订阅](/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription#setting-up-a-trial-of-github-copilot)”和“[关于 {% data variables.product.prodname_copilot %}](/copilot/overview-of-github-copilot/about-github-copilot)”。 +- **{% data variables.product.prodname_github_codespaces %}** :{% data reusables.education.student-codespaces-benefit %} 有关 {% data variables.product.prodname_github_codespaces %} 入门信息,请参阅“[{% data variables.product.prodname_github_codespaces %} 概述](/codespaces/overview)”。 {% note %} -**Note:** {% data reusables.education.note-on-student-codespaces-usage %} For more information, see "[Using {% data variables.product.prodname_github_codespaces %} with {% data variables.product.prodname_classroom %}](/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide/using-github-codespaces-with-github-classroom)." +注意:{% data reusables.education.note-on-student-codespaces-usage %} 有关详细信息,请参阅“[在 {% data variables.product.prodname_classroom %} 中使用 {% data variables.product.prodname_github_codespaces %}](/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide/using-github-codespaces-with-github-classroom)”。 {% endnote %} -## Further reading +## 延伸阅读 -- "[About {% data variables.product.prodname_global_campus %} for teachers](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-teachers/about-github-global-campus-for-teachers)" -- "[About {% data variables.product.prodname_community_exchange %}](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-students/about-github-community-exchange)" +- [关于教师版 {% data variables.product.prodname_global_campus %}](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-teachers/about-github-global-campus-for-teachers) +- [关于 {% data variables.product.prodname_community_exchange %}](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-students/about-github-community-exchange) diff --git a/translations/zh-CN/content/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-teachers/about-github-global-campus-for-teachers.md b/translations/zh-CN/content/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-teachers/about-github-global-campus-for-teachers.md index dc7a203cd0..cf8914c684 100644 --- a/translations/zh-CN/content/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-teachers/about-github-global-campus-for-teachers.md +++ b/translations/zh-CN/content/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-teachers/about-github-global-campus-for-teachers.md @@ -1,6 +1,6 @@ --- -title: About GitHub Global Campus for teachers -intro: '{% data variables.product.prodname_global_campus %} offers teachers a central place to access tools and resources for working more effectively inside and outside of the classroom.' +title: 关于教师版 GitHub Global Campus +intro: '{% data variables.product.prodname_global_campus %} 为教师提供了一个访问工具和资源的中心位置,使他们能够在课堂内外更高效地工作。' redirect_from: - /education/teach-and-learn-with-github-education/about-github-education-for-educators-and-researchers - /github/teaching-and-learning-with-github-education/about-github-education-for-educators-and-researchers @@ -10,28 +10,32 @@ redirect_from: versions: fpt: '*' shortTitle: For teachers +ms.openlocfilehash: 2a93f87df67d1694bd93888d29a582afa9c749e4 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158963' --- +作为认证教育机构的教职员工,你可以申请 {% data variables.product.prodname_global_campus %},其中包括 {% data variables.product.prodname_education %} 权益和资源。 有关详细信息,请参阅“[以教师身份申请加入 {% data variables.product.prodname_global_campus %}](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-teachers/apply-to-github-global-campus-as-a-teacher)”。 -As a faculty member at an accredited educational institution, you can apply for {% data variables.product.prodname_global_campus %}, which includes {% data variables.product.prodname_education %} benefits and resources. For more information, see "[Apply to {% data variables.product.prodname_global_campus %} as a teacher](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-teachers/apply-to-github-global-campus-as-a-teacher)." +{% data variables.product.prodname_global_campus %} 是一个门户,使 GitHub Education Community 能够在一个位置访问其教育权益。 当你成为经过验证的 {% data variables.product.prodname_global_campus %} 教师后,可随时转到 [{% data variables.product.prodname_education %} 网站](https://education.github.com)来访问 {% data variables.product.prodname_global_campus %}。 -{% data variables.product.prodname_global_campus %} is a portal that allows the GitHub Education Community to access their education benefits, all in one place. Once you are a verified {% data variables.product.prodname_global_campus %} teacher, you can access {% data variables.product.prodname_global_campus %} anytime by going to the [{% data variables.product.prodname_education %} website](https://education.github.com). +![教师版 {% data variables.product.prodname_global_campus %} 门户](/assets/images/help/education/global-campus-portal-teachers.png) -![{% data variables.product.prodname_global_campus %} portal for teachers](/assets/images/help/education/global-campus-portal-teachers.png) +在申请个人折扣之前,请检查你的学习社区是否已作为 {% data variables.product.prodname_campus_program %} 学校与我们合作。 有关详细信息,请参阅“[关于 {% data variables.product.prodname_campus_program %}](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/about-github-campus-program)”。 -Before applying for an individual discount, check if your learning community is already partnered with us as a {% data variables.product.prodname_campus_program %} school. For more information, see "[About {% data variables.product.prodname_campus_program %}](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/about-github-campus-program)." +## 教师版 {% data variables.product.prodname_global_campus %} 功能 -## {% data variables.product.prodname_global_campus %} features for teachers +{% data variables.product.prodname_global_campus %} 是一个一站式门户,你可从中访问 {% data variables.product.prodname_education %} 权益和资源。 在 {% data variables.product.prodname_global_campus %} 门户中,各级教师都可以:{% data reusables.education.apply-for-team %} + - 查看活动 [{% data variables.product.prodname_classroom %}](https://classroom.github.com) 的概览,其中包括一目了然的最近作业和课堂进度,以及指向 {% data variables.product.prodname_classroom %} 的链接。 + - 查看世界各地的同行发布的 [{% data variables.product.prodname_discussions %}](https://github.com/orgs/community/discussions/categories/github-education) 并在其中互动来讨论技术教育的当前趋势,并查看 [{% data variables.product.prodname_education %} 博客](https://github.blog/category/education/)的最新文章。 + - 查看 {% data variables.product.prodname_education %} 和学生领袖策划的学生活动。 + - 重新观看最近的 [Campus TV](https://www.twitch.tv/githubeducation) 剧集,了解学生社区对什么感兴趣。 Campus TV 由 {% data variables.product.prodname_dotcom %} 和学生社区领袖创建,可观看直播或按需观看。 + - 请求一个 {% data variables.product.prodname_dotcom %} swag 包,其中包含为学生提供的教育材料和超值服务。 -{% data variables.product.prodname_global_campus %} is a portal from which you can access your {% data variables.product.prodname_education %} benefits and resources, all in one place. On the {% data variables.product.prodname_global_campus %} portal, teachers of all levels can: - {% data reusables.education.apply-for-team %} - - View an overview of your active [{% data variables.product.prodname_classroom %}](https://classroom.github.com), including recent assignments and your class's progress at a glance, as well as links to {% data variables.product.prodname_classroom %}. - - View and interact with [{% data variables.product.prodname_discussions %}](https://github.com/orgs/community/discussions/categories/github-education) posted by your peers from around the world to discuss current trends in technology education, and see the latest posts from our [{% data variables.product.prodname_education %} blog](https://github.blog/category/education/). - - See student events curated by {% data variables.product.prodname_education %} and student leaders. - - Stay in the know on what the student community is interested in by rewatching recent [Campus TV](https://www.twitch.tv/githubeducation) episodes. Campus TV is created by {% data variables.product.prodname_dotcom %} and student community leaders and can be watched live or on demand. - - Request a {% data variables.product.prodname_dotcom %} swag bag with educational materials and goodies for your students. +{% data variables.product.prodname_copilot %} 的免费订阅可供通过 {% data variables.product.prodname_education %} 验证的教师使用。 在帐户设置中访问 {% data variables.product.prodname_copilot %} 订阅页时,将自动收到有关免费订阅的通知。 有关订阅和使用 {% data variables.product.prodname_copilot %} 的详细信息,请参阅“[管理 {% data variables.product.prodname_copilot %} 订阅](/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription#setting-up-a-trial-of-github-copilot)”和“[关于 {% data variables.product.prodname_copilot %}](/copilot/overview-of-github-copilot/about-github-copilot)”。 -A free subscription for {% data variables.product.prodname_copilot %} is available to verified teachers with {% data variables.product.prodname_education %}. You will be automatically notified about the free subscription when you visit the {% data variables.product.prodname_copilot %} subscription page in your account settings. For more information about subscribing to and using {% data variables.product.prodname_copilot %}, see "[Managing your {% data variables.product.prodname_copilot %} subscription](/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription#setting-up-a-trial-of-github-copilot)" and "[About {% data variables.product.prodname_copilot %}](/copilot/overview-of-github-copilot/about-github-copilot)." +## 延伸阅读 -## Further reading - -- "[About {% data variables.product.prodname_global_campus %} for students](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-students/about-github-global-campus-for-students)" +- [关于学生版 {% data variables.product.prodname_global_campus %}](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-students/about-github-global-campus-for-students) diff --git a/translations/zh-CN/content/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide/using-github-codespaces-with-github-classroom.md b/translations/zh-CN/content/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide/using-github-codespaces-with-github-classroom.md index 34a57ee0e7..f5015406c0 100644 --- a/translations/zh-CN/content/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide/using-github-codespaces-with-github-classroom.md +++ b/translations/zh-CN/content/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide/using-github-codespaces-with-github-classroom.md @@ -1,27 +1,33 @@ --- -title: Using GitHub Codespaces with GitHub Classroom +title: 将 GitHub Codespaces 与 GitHub Classroom 配合使用 shortTitle: Using Codespaces with GitHub Classroom product: '{% data reusables.gated-features.codespaces-classroom-articles %}' -intro: 'You can use {% data variables.product.prodname_github_codespaces %} as the preferred editor in your assignments to give students access to a browser-based Visual Studio Code environment with one-click setup.' +intro: '你可以将 {% data variables.product.prodname_github_codespaces %} 用作你作业中的首选编辑器,使学生能够通过一键式设置访问基于浏览器的 Visual Studio Code 环境。' versions: fpt: '*' permissions: 'Organization owners who are admins for a classroom can enable {% data variables.product.prodname_github_codespaces %} for their organization and integrate {% data variables.product.prodname_github_codespaces %} as the supported editor for an assignment. {% data reusables.classroom.classroom-admins-link %}' +ms.openlocfilehash: 6794d20b9ea0153b3baf4bee1a08c68b2ba17456 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158875' --- -## About {% data variables.product.prodname_github_codespaces %} +## 关于 {% data variables.product.prodname_github_codespaces %} -{% data variables.product.prodname_github_codespaces %} is an instant, cloud-based development environment that uses a container to provide you with common languages, tools, and utilities for development. {% data variables.product.prodname_github_codespaces %} is also configurable, allowing you to create a customized development environment that is the same for all users of your project. For more information, see "[{% data variables.product.prodname_github_codespaces %} overview](/codespaces/overview)." +{% data variables.product.prodname_github_codespaces %} 是一个基于云的即时开发环境,它使用容器为你提供用于开发的通用语言、工具和实用程序。 {% data variables.product.prodname_github_codespaces %} 也是可配置的,使你能为项目的所有用户创建相同的自定义开发环境。 有关详细信息,请参阅“[{% data variables.product.prodname_github_codespaces %} 概述](/codespaces/overview)”。 -Once {% data variables.product.prodname_github_codespaces %} is enabled in an organization or enterprise, users can create a codespace from any branch or commit in an organization or enterprise repository and begin developing using cloud-based compute resources. You can connect to a codespace from the browser or locally using Visual Studio Code. +在组织或企业中启用 {% data variables.product.prodname_github_codespaces %} 后,用户可以从组织或企业存储库中的任何分支或提交创建 codespace,并开始使用基于云的计算资源进行开发。 可以使用 Visual Studio Code 从浏览器或本地连接到 codespace。 {% data reusables.codespaces.links-to-get-started %} -Setting {% data variables.product.prodname_github_codespaces %} as the preferred editor for an assignment in GitHub Classroom assignments, is beneficial for both students and teachers. {% data variables.product.prodname_github_codespaces %} is a good option for students using loaned devices or without access to a local IDE setup, since each codespace is cloud-based and requires no local setup. Students can launch a codespace for an assignment repository in Visual Studio Code directly in their browser, and begin developing right away without needing any further configuration. +将 {% data variables.product.prodname_github_codespaces %} 设置为 GitHub Classroom 作业的首选编辑器对学生和教师都很有用。 {% data variables.product.prodname_github_codespaces %} 是使用租赁设备或无法访问本地 IDE 设置的学生的理想选择,因为每个 codespace 都是基于云的,不需要进行本地设置。 学生可以直接在浏览器中为 Visual Studio Code 中的作业存储库启动 codespace,并立即开始开发,而无需进一步的配置。 -For assignments with complex setup environments, teachers can customize the dev container configuration for a repository's codespaces. This ensures that when a student creates a codespace, it automatically opens with the development environment configured by the teacher. For more information on dev containers, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)." +对于具有复杂设置环境的作业,教师可以自定义存储库 codespace 的开发容器配置。 这可以确保学生在创建 codespace 时,它会自动打开由教师配置的开发环境。 有关开发容器的详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)”。 {% note %} -**Note**: Individual codespaces are automatically deleted if they are stopped and left unused for a prolonged period. For more information, see "[Configuring automatic deletion of your codespaces](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces)." +注意:各个 codespace 会在停止且长时间未使用的情况下自动删除。 有关详细信息,请参阅“[配置 codespace 的自动删除](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces)”。 {% endnote %} @@ -29,74 +35,72 @@ For assignments with complex setup environments, teachers can customize the dev {% note %} -**Note:** {% data reusables.education.note-on-student-codespaces-usage %} +注意:{% data reusables.education.note-on-student-codespaces-usage %} {% endnote %} -## About the {% data variables.product.prodname_codespaces %} Education benefit for verified teachers +## 关于经过验证的教师的 {% data variables.product.prodname_codespaces %} 教育权益 -The {% data variables.product.prodname_codespaces %} Education benefit gives verified teachers a free monthly allowance of {% data variables.product.prodname_github_codespaces %} hours to use in {% data variables.product.prodname_classroom %}. The free allowance is estimated to be enough for a class of 50 with 5 assignments per month, on a 2 core machine with 1 codespace stored per student. +{% data variables.product.prodname_codespaces %} 教育权益为经过验证的教师提供每月限额的免费 {% data variables.product.prodname_github_codespaces %} 小时数,可在 {% data variables.product.prodname_classroom %} 中使用。 免费限额估计足够一个每月有 5 次作业的 50 人班级使用,在一台双核机器上,每个学生存储 1 个 codespace。 {% data reusables.classroom.free-limited-codespaces-for-verified-teachers-beta-note %} -To become a verified teacher, you need to be approved for an educator or teacher benefit. For more information, see "[Apply to {% data variables.product.prodname_global_campus %} as a teacher](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-teachers/apply-to-github-global-campus-as-a-teacher)." +若要成为经过验证的教师,需要获得教师权益的批准。 有关详细信息,请参阅“[以教师身份申请加入 {% data variables.product.prodname_global_campus %}](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-teachers/apply-to-github-global-campus-as-a-teacher)”。 -After you have confirmation that you are a verified teacher, visit [{% data variables.product.prodname_global_campus %} for Teachers](https://education.github.com/globalcampus/teacher) to upgrade the organization to GitHub Team. For more information, see [GitHub's products](/get-started/learning-about-github/githubs-products#github-team). +在确认你是一名经过验证的教师后,请访问 [{% data variables.product.prodname_global_campus %} for Teachers](https://education.github.com/globalcampus/teacher),将组织升级为 GitHub 团队。 有关详细信息,请参阅“[GitHub 的产品](/get-started/learning-about-github/githubs-products#github-team)”。 -If you are eligible for the {% data variables.product.prodname_codespaces %} Education benefit, when you enable {% data variables.product.prodname_github_codespaces %} in {% data variables.product.prodname_classroom %} for your organization, GitHub automatically adds a Codespace policy to restrict machine types for all codespaces in the organization to 2 core machines. This helps you make the most of the free {% data variables.product.prodname_github_codespaces %} usage. However, you can change or remove these policies in your organization settings. For more information, see "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)." +如果你有资格获得 {% data variables.product.prodname_codespaces %} 教育权益,则当你在 {% data variables.product.prodname_classroom %} 中为组织启用 {% data variables.product.prodname_github_codespaces %} 时,GitHub 会自动添加 Codespace 策略,以将组织内所有 codespace 的计算机类型限制为双核计算机。 这有助于充分利用免费的 {% data variables.product.prodname_github_codespaces %} 使用量。 但是,可以在组织设置中更改或移除这些策略。 有关详细信息,请参阅“[限制对计算机类型的访问](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)”。 -When the {% data variables.product.prodname_codespaces %} Education benefit moves out of beta, if your organization exceeds their free allowance for {% data variables.product.prodname_github_codespaces %} usage, your organization will be billed for additional usage. For more information, see "[About billing for {% data variables.product.prodname_github_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)." +当 {% data variables.product.prodname_codespaces %} 教育权益移出 beta 版时,如果你的组织超出 {% data variables.product.prodname_github_codespaces %} 的免费使用限额,则你的组织将因额外使用量而付费。 有关详细信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)”。 -## Enabling {% data variables.product.prodname_codespaces %} for your organization +## 为组织启用 {% data variables.product.prodname_codespaces %} -{% data variables.product.prodname_github_codespaces %} is available to use with {% data variables.product.prodname_classroom %} for organizations that use {% data variables.product.prodname_team %}. If you are eligible for the {% data variables.product.prodname_codespaces %} Education benefit, you must enable {% data variables.product.prodname_github_codespaces %} through {% data variables.product.prodname_classroom %}, instead of enabling it directly in your organization settings. Otherwise, your organization will be billed directly for all usage of {% data variables.product.prodname_github_codespaces %}. +对于使用 {% data variables.product.prodname_team %} 的组织,{% data variables.product.prodname_github_codespaces %} 可与 {% data variables.product.prodname_classroom %} 搭配使用。 如果你有资格获得 {% data variables.product.prodname_codespaces %} 教育权益,则必须通过 {% data variables.product.prodname_classroom %} 启用 {% data variables.product.prodname_github_codespaces %},而不是直接在你的组织设置中启用它。 否则,你的组织将直接针对 {% data variables.product.prodname_github_codespaces %} 的所有使用量付费。 -### Enabling Codespaces for an organization when creating a new classroom +### 创建新课堂时为组织启用 Codespaces {% data reusables.classroom.sign-into-github-classroom %} -1. Click **New classroom**. +1. 单击“新建教室”。 - !["New classroom" button](/assets/images/help/classroom/click-new-classroom-button.png) + ![“新建课堂”按钮](/assets/images/help/classroom/click-new-classroom-button.png) -1. In the list of organizations, click the organization you'd like to use for your classroom. Organizations that are eligible for {% data variables.product.prodname_github_codespaces %} will have a note showing that they are eligible. Optionally, you can create a new organization. For more information, see "[Creating a new organization from scratch](/organizations/collaborating-with-groups-in-organizations/creating-a-new-organization-from-scratch)." +1. 在组织列表中,单击您希望用于教室的组织。 有资格使用 {% data variables.product.prodname_github_codespaces %} 的组织将有一条备注,显示他们符合条件。 (可选)您可以创建一个新组织。 有关详细信息,请参阅[从头开始创建新组织](/organizations/collaborating-with-groups-in-organizations/creating-a-new-organization-from-scratch)。 - ![Choose organization for classroom with codespaces eligibility](/assets/images/help/classroom/org-view-codespaces-eligibility.png) + ![为具有 codespace 资格的课堂选择组织](/assets/images/help/classroom/org-view-codespaces-eligibility.png) -1. In the "Name your classroom" page, under "{% data variables.product.prodname_codespaces %} in your Classroom", click **Enable**. Note that this will enable {% data variables.product.prodname_github_codespaces %} for all repositories and users in the organization. +1. 在“命名课堂”页的“课堂中的 {% data variables.product.prodname_codespaces %}”下,单击“启用”。 请注意,这将为组织中的所有存储库和用户启用 {% data variables.product.prodname_github_codespaces %}。 - ![Enable Codespaces for org in "Setup classroom basics" page](/assets/images/help/classroom/setup-classroom-enable-codespaces-button.png) + ![在“设置课堂基础知识”页中为组织启用 Codespaces](/assets/images/help/classroom/setup-classroom-enable-codespaces-button.png) -1. When you are ready to create the new classroom, click **Create classroom**. +1. 准备好创建新课堂时,单击“创建课堂”。 -### Enabling Codespaces for an organization via an existing classroom +### 通过现有课堂为组织启用 Codespaces -{% data reusables.classroom.sign-into-github-classroom %} -{% data reusables.classroom.click-classroom-in-list %} -{% data reusables.classroom.click-settings %} -1. Under "{% data variables.product.prodname_github_codespaces %}", click **Enable**. This will enable {% data variables.product.prodname_github_codespaces %} for all repositories and users in the organization. A new Codespace policy is also added to restrict machine types for all codespaces in the organization to 2 core machines. +{% data reusables.classroom.sign-into-github-classroom %} {% data reusables.classroom.click-classroom-in-list %} {% data reusables.classroom.click-settings %} +1. 在“{% data variables.product.prodname_github_codespaces %}”下,单击“启用”。 这将为组织中的所有存储库和用户启用 {% data variables.product.prodname_github_codespaces %}。 还添加了新的 Codespace 策略,用于将组织中所有 codespace 的计算机类型限制为双核计算机。 - ![Enable Codespaces for org in existing classroom settings](/assets/images/help/classroom/classroom-settings-enable-codespaces-button.png) + ![为现有课堂设置中的组织启用 Codespaces](/assets/images/help/classroom/classroom-settings-enable-codespaces-button.png) -You can use the same methods as above to disable {% data variables.product.prodname_github_codespaces %} for your organization as well. Note that this will disable {% data variables.product.prodname_github_codespaces %} for all users and repositories in the organization. +还可以使用与上述相同的方法为组织禁用 {% data variables.product.prodname_github_codespaces %}。 请注意,这将为组织中的所有用户和存储库禁用 {% data variables.product.prodname_github_codespaces %}。 -## Configuring an assignment to use {% data variables.product.prodname_codespaces %} -To make {% data variables.product.prodname_github_codespaces %} available to students for an assignment, you can choose {% data variables.product.prodname_github_codespaces %} as the supported editor for the assignment. When creating a new assignment, in the "Add your starter code and choose your optional online IDE" page, under "Add a supported editor", select **{% data variables.product.prodname_github_codespaces %}** from the dropdown menu. +## 配置作业以使用 {% data variables.product.prodname_codespaces %} +若要使学生可以使用 {% data variables.product.prodname_github_codespaces %} 来完成作业,可以选择 {% data variables.product.prodname_github_codespaces %} 作为作业支持的编辑器。 创建新作业时,在“添加初学者代码并选择可选的联机 IDE”页的“添加受支持的编辑器”下,从下拉菜单中选择“{% data variables.product.prodname_github_codespaces %}”。 -![Select Codespaces as supported editor for assignment](/assets/images/help/classroom/select-supported-editor-including-codespaces.png) +![选择 Codespaces 作为作业支持的编辑器](/assets/images/help/classroom/select-supported-editor-including-codespaces.png) -If you use a template repository for an assignment, you can define a dev container in the repository to customize the tools and runtimes available to students when they launch a codespace to work on the assignment. If you do not define a dev container, {% data variables.product.prodname_github_codespaces %} will use a default configuration, which contains many of the common tools that your students might need for development. For more information on defining a dev container, see "[Add a dev container configuration to your repository](/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces)." +如果使用模板存储库完成作业,则可以在存储库中定义开发容器,以便在学生启动 codespace 处理作业时自定义可供学生使用的工具和运行时。 如果未定义开发容器,{% data variables.product.prodname_github_codespaces %} 将使用默认配置,其中包含学生可能需要开发的许多常用工具。 有关定义开发容器的详细信息,请参阅“[将开发容器配置添加到存储库](/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces)”。 -## Launching an assignment using {% data variables.product.prodname_github_codespaces %} +## 使用 {% data variables.product.prodname_github_codespaces %} 启动作业 -When a student opens an assignment, the repository's README file includes their teacher's recommendation of the IDE they should use for the work. +当学生打开作业时,存储库的自述文件包括其教师建议的 IDE,他们应该使用该 IDE 来完成工作。 -![Screenshot of the Codespaces note in the README for a student assignment repository](/assets/images/help/classroom/student-codespaces-readme-link.png) +![学生作业存储库自述文件中 Codespaces 备注的屏幕截图](/assets/images/help/classroom/student-codespaces-readme-link.png) -Students can launch a new or existing codespace by clicking the **Open in GitHub Codespace** button in the README, or by clicking the **{% octicon "code" aria-label="The code icon" %} Code** button on the main page of the assignment repository, then selecting the **Codespaces** tab. From the **Codespaces** tab you can select an existing codespace or create a new one. For more information, see "[Creating a codespace for a repository](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)." +学生可以通过单击 README 中的“在 GitHub Codespace 中打开”按钮,或通过单击作业存储库主页上的“{% octicon "code" aria-label="The code icon" %} 代码”按钮,然后选择“Codespaces”选项卡来启动新的或现有的 codespace。在“Codespaces”选项卡中,可以选择现有 codespace 或新建一个 。 有关详细信息,请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository)”。 -![Launch new codespace in assignment repository](/assets/images/help/classroom/student-launch-new-codespace.png) +![在作业存储库中启动新的 codespace](/assets/images/help/classroom/student-launch-new-codespace.png) -Teachers can view each student's codespace for an assignment in the assignment overview page. You can click on the Codespaces icon on the right side of each student row to launch the codespace. +教师可以在作业概述页中查看每个学生的作业 codespace。 可以单击每个学生行右侧的 Codespaces 图标以启动 codespace。 -![Teacher assignment overview with student's codespaces](/assets/images/help/classroom/teacher-assignment-view-with-codespaces.png) +![学生 codespace 的教师作业概述](/assets/images/help/classroom/teacher-assignment-view-with-codespaces.png) -When you connect to a codespace through a browser, auto-save is enabled automatically. If you want to save changes to the repository, you will need to commit the changes and push them to a remote branch. If you leave your codespace running without interaction for 30 minutes by default, the codespace will timeout and stop running. Your data will be preserved from the last time you made a change. For more information on the lifecycle of a codespace, see "[The codespace lifecycle](/codespaces/developing-in-codespaces/the-codespace-lifecycle)." +通过浏览器连接到 codespace 时,会自动启用自动保存。 如果要将更改保存到存储库,则需要提交更改并将其推送到远程分支。 如果默认情况下允许 codespace 在没有互动的情况下运行 30 分钟,codespace 将超时并停止运行。 将保留上次更改以来的数据。 有关 codespace 生命周期的详细信息,请参阅“[codespace 生命周期](/codespaces/developing-in-codespaces/the-codespace-lifecycle)”。 diff --git a/translations/zh-CN/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/create-a-group-assignment.md b/translations/zh-CN/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/create-a-group-assignment.md index 66cdb5d8b3..ffef0a4aba 100644 --- a/translations/zh-CN/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/create-a-group-assignment.md +++ b/translations/zh-CN/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/create-a-group-assignment.md @@ -74,6 +74,8 @@ If you've already created a group assignment for the classroom, you can reuse a ### Choosing a visibility for assignment repositories +{% data reusables.classroom.assignments-repository-visibility-and-permissions %} + {% data reusables.classroom.assignments-guide-choose-visibility %} {% data reusables.classroom.assignments-guide-click-continue-after-basics %} diff --git a/translations/zh-CN/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/create-an-individual-assignment.md b/translations/zh-CN/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/create-an-individual-assignment.md index 8d9d4eecb3..8161608b81 100644 --- a/translations/zh-CN/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/create-an-individual-assignment.md +++ b/translations/zh-CN/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/create-an-individual-assignment.md @@ -1,6 +1,6 @@ --- -title: 创建个人作业 -intro: 您可以为课程中的学生创建需单独完成的作业。 +title: Create an individual assignment +intro: You can create an assignment for students in your course to complete individually. versions: fpt: '*' permissions: 'Organization owners who are admins for a classroom can create and manage individual assignments for a classroom. {% data reusables.classroom.classroom-admins-link %}' @@ -8,14 +8,8 @@ redirect_from: - /education/manage-coursework-with-github-classroom/creating-an-individual-assignment - /education/manage-coursework-with-github-classroom/create-an-individual-assignment shortTitle: Individual assignment -ms.openlocfilehash: 4f5fab2f63ff686762a4fb6ccd5964b7f4d9cb3c -ms.sourcegitcommit: 47bd0e48c7dba1dde49baff60bc1eddc91ab10c5 -ms.translationtype: HT -ms.contentlocale: zh-CN -ms.lasthandoff: 09/05/2022 -ms.locfileid: '147573866' --- -## 关于个人作业 +## About individual assignments {% data reusables.classroom.assignments-individual-definition %} @@ -23,82 +17,84 @@ ms.locfileid: '147573866' {% data reusables.classroom.about-assignments %} -有关创建个人作业的视频演示,请参阅“[设置 {% data variables.product.prodname_classroom %} 的基本信息](/education/manage-coursework-with-github-classroom/basics-of-setting-up-github-classroom)”。 +For a video demonstration of the creation of an individual assignment, see "[Basics of setting up {% data variables.product.prodname_classroom %}](/education/manage-coursework-with-github-classroom/basics-of-setting-up-github-classroom)." {% data reusables.classroom.reuse-assignment-link %} -## 先决条件 +## Prerequisites {% data reusables.classroom.assignments-classroom-prerequisite %} -## 创建作业 +## Creating an assignment {% data reusables.classroom.assignments-guide-create-the-assignment %} -## 设置作业的基本信息 +## Setting up the basics for an assignment -指定作业的名称,决定是否分配截止时间,并选择作业仓库的可见性。 +Name your assignment, decide whether to assign a deadline, and choose the visibility of assignment repositories. -- [指定作业名称](#naming-an-assignment) -- [分配作业的截止时间](#assigning-a-deadline-for-an-assignment) -- [选择作业类型](#choosing-an-assignment-type) -- [选择作业存储库的可见性](#choosing-a-visibility-for-assignment-repositories) +- [Naming an assignment](#naming-an-assignment) +- [Assigning a deadline for an assignment](#assigning-a-deadline-for-an-assignment) +- [Choosing an assignment type](#choosing-an-assignment-type) +- [Choosing a visibility for assignment repositories](#choosing-a-visibility-for-assignment-repositories) -### 指定作业名称 +### Naming an assignment -对于个人作业,{% data variables.product.prodname_classroom %} 使用仓库前缀和学生的 {% data variables.product.product_name %} 用户名对仓库命名。 默认情况下,仓库前缀是作业标题。 例如,如果你对作业 "assignment-1" 命名,学生在 {% data variables.product.product_name %} 上的用户名是 @octocat,则 @octocat 的作业存储库的名称将是 `assignment-1-octocat`。 +For an individual assignment, {% data variables.product.prodname_classroom %} names repositories by the repository prefix and the student's {% data variables.product.product_name %} username. By default, the repository prefix is the assignment title. For example, if you name an assignment "assignment-1" and the student's username on {% data variables.product.product_name %} is @octocat, the name of the assignment repository for @octocat will be `assignment-1-octocat`. {% data reusables.classroom.assignments-type-a-title %} -### 分配作业的截止时间 +### Assigning a deadline for an assignment {% data reusables.classroom.assignments-guide-assign-a-deadline %} -### 选择作业类型 +### Choosing an assignment type -在“个人或小组作业”下,选择下拉菜单,并单击“个人作业”。 创建作业后不可更改作业类型。 如果想要创建小组作业,请参阅“[创建小组作业](/education/manage-coursework-with-github-classroom/create-a-group-assignment)”。 +Under "Individual or group assignment", select the drop-down menu, and click **Individual assignment**. You can't change the assignment type after you create the assignment. If you'd rather create a group assignment, see "[Create a group assignment](/education/manage-coursework-with-github-classroom/create-a-group-assignment)." -### 选择作业仓库的可见性 +### Choosing a visibility for assignment repositories + +{% data reusables.classroom.assignments-repository-visibility-and-permissions %} {% data reusables.classroom.assignments-guide-choose-visibility %} {% data reusables.classroom.assignments-guide-click-continue-after-basics %} -## 添加起始代码并配置开发环境 +## Adding starter code and configuring a development environment {% data reusables.classroom.assignments-guide-intro-for-environment %} -- [选择模板存储库](#choosing-a-template-repository) -- [选择集成开发环境 (IDE)](#choosing-an-integrated-development-environment-ide) +- [Choosing a template repository](#choosing-a-template-repository) +- [Choosing an integrated development environment (IDE)](#choosing-an-integrated-development-environment-ide) -### 选择模板仓库 +### Choosing a template repository -默认情况下,新作业将为教室名册上的每个学生创建一个空仓库。 {% data reusables.classroom.you-can-choose-a-template-repository %} +By default, a new assignment will create an empty repository for each student on the roster for the classroom. {% data reusables.classroom.you-can-choose-a-template-repository %} {% data reusables.classroom.assignments-guide-choose-template-repository %} {% data reusables.classroom.assignments-guide-click-continue-after-starter-code-and-feedback %} -### 选择集成开发环境 (IDE) +### Choosing an integrated development environment (IDE) -{% data reusables.classroom.about-online-ides %} 有关详细信息,请参阅“[将 {% data variables.product.prodname_classroom %} 与 IDE 集成](/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide)”。 +{% data reusables.classroom.about-online-ides %} For more information, see "[Integrate {% data variables.product.prodname_classroom %} with an IDE](/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide)." {% data reusables.classroom.classroom-codespaces-link %} {% data reusables.classroom.assignments-guide-choose-an-online-ide %} -## 为作业提供反馈 +## Providing feedback for an assignment -(可选)您可以自动对作业进行分级,并创建一个空间,用于与学生讨论每个提交。 +Optionally, you can automatically grade assignments and create a space for discussing each submission with the student. -- [自动测试作业](#testing-assignments-automatically) -- [为反馈创建拉取请求](#creating-a-pull-request-for-feedback) +- [Testing assignments automatically](#testing-assignments-automatically) +- [Creating a pull request for feedback](#creating-a-pull-request-for-feedback) -### 自动测试作业 +### Testing assignments automatically {% data reusables.classroom.assignments-guide-using-autograding %} -### 为反馈创建拉取请求 +### Creating a pull request for feedback {% data reusables.classroom.you-can-create-a-pull-request-for-feedback %} @@ -106,34 +102,34 @@ ms.locfileid: '147573866' {% data reusables.classroom.assignments-guide-click-create-assignment-button %} -## 邀请学生参加作业 +## Inviting students to an assignment {% data reusables.classroom.assignments-guide-invite-students-to-assignment %} -你可以在作业的“课堂名册”选项卡中查看学生是否已进入教室以及是否接受或提交作业。 你还可以在此选项卡中将学生的 {% data variables.product.prodname_dotcom %} 别名链接到其关联的名册标识符,反之亦然。{% data reusables.classroom.assignments-to-prevent-submission %} +You can see whether a student has joined the classroom and accepted or submitted an assignment in the **Classroom roster** tab for the assignment. You can also link students' {% data variables.product.prodname_dotcom %} aliases to their associated roster identifier and vice versa in this tab. {% data reusables.classroom.assignments-to-prevent-submission %}
Individual assignment
-## 监控学生的进度 -作业概述页面提供了作业接受情况和学生进度的概述。 根据作业的配置,您可能有不同的摘要信息。 +## Monitoring students' progress +The assignment overview page provides an overview of your assignment acceptances and student progress. You may have different summary information based on the configurations of your assignments. -- **名册内学生**:课堂名册上的学生人数。 -- **已添加的学生**:已接受作业且未与名册标识符关联的 {% data variables.product.prodname_dotcom %} 帐户数。 -- **已接受的学生**:已接受此作业的帐户数。 -- **作业提交**:已提交作业的学生人数。 在作业截止日期触发提交。 -- **及格学生**:当前通过此作业的自动评分测试的学生人数。 +- **Rostered students**: The number of students on the Classroom's roster. +- **Added students**: The number of {% data variables.product.prodname_dotcom %} accounts that have accepted the assignment and are not associated with a roster identifier. +- **Accepted students**: The number of accounts have accepted this assignment. +- **Assignment submissions**: The number of students that have submitted the assignment. Submission is triggered at the assignment deadline. +- **Passing students**: The number of students currently passing the autograding tests for this assignment. -## 后续步骤 +## Next steps -- 在创建作业后,学生可以使用 Git 和 {% data variables.product.product_name %} 的功能开始处理作业。 学生可以克隆仓库、推送提交、管理分支、创建和审查拉取请求、解决合并冲突以及讨论议题的更改。 您和学生都可以审查仓库的提交历史记录。 有关详细信息,请参阅“[开始使用 {% data variables.product.prodname_dotcom %}](/github/getting-started-with-github)”、“[存储库](/repositories)”和“[协作处理问题和拉取请求](/github/collaborating-with-issues-and-pull-requests)”。 +- Once you create the assignment, students can start work on the assignment using Git and {% data variables.product.product_name %}'s features. Students can clone the repository, push commits, manage branches, create and review pull requests, address merge conflicts, and discuss changes with issues. Both you and student can review the commit history for the repository. For more information, see "[Getting started with {% data variables.product.prodname_dotcom %}](/github/getting-started-with-github)," "[Repositories](/repositories)," and "[Collaborating with issues and pull requests](/github/collaborating-with-issues-and-pull-requests)." -- 当学生完成作业时,您可以查看仓库中的文件,或者查看仓库的历史和可视化内容,以更好地了解学生的工作。 有关详细信息,请参阅“[使用图表可视化存储库数据](/github/visualizing-repository-data-with-graphs)”。 +- When a student finishes an assignment, you can review the files in the repository, or you can review the history and visualizations for the repository to better understand the student's work. For more information, see "[Visualizing repository data with graphs](/github/visualizing-repository-data-with-graphs)." -- 您可以通过在拉取请求中评论个别提交或行来提供作业反馈。 有关详细信息,请参阅“[对拉取请求添加注释](/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/commenting-on-a-pull-request)”和“[从代码中打开问题](/github/managing-your-work-on-github/opening-an-issue-from-code)”。 有关创建已保存回复以提供常见错误反馈的详细信息,请参阅“[关于已保存回复](/github/writing-on-github/about-saved-replies)”。 +- You can provide feedback for an assignment by commenting on individual commits or lines in a pull request. For more information, see "[Commenting on a pull request](/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/commenting-on-a-pull-request)" and "[Opening an issue from code](/github/managing-your-work-on-github/opening-an-issue-from-code)." For more information about creating saved replies to provide feedback for common errors, see "[About saved replies](/github/writing-on-github/about-saved-replies)." -## 延伸阅读 +## Further reading -- [教师版 {% data variables.product.prodname_global_campus %}](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-teachers) -- [将学习管理系统连接到 {% data variables.product.prodname_classroom %}](/education/manage-coursework-with-github-classroom/connect-a-learning-management-system-to-github-classroom) +- "[{% data variables.product.prodname_global_campus %} for teachers](/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-teachers)" +- "[Connect a learning management system to {% data variables.product.prodname_classroom %}](/education/manage-coursework-with-github-classroom/teach-with-github-classroom/connect-a-learning-management-system-course-to-a-classroom)" diff --git a/translations/zh-CN/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/index.md b/translations/zh-CN/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/index.md index 6f30d24cc8..fe01e69382 100644 --- a/translations/zh-CN/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/index.md +++ b/translations/zh-CN/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/index.md @@ -11,6 +11,7 @@ children: - /use-the-git-and-github-starter-assignment - /create-an-individual-assignment - /create-a-group-assignment + - /editing-an-assignment - /reuse-an-assignment - /create-an-assignment-from-a-template-repository - /leave-feedback-with-pull-requests @@ -18,11 +19,11 @@ children: - /register-a-learning-management-system-with-github-classroom - /connect-a-learning-management-system-course-to-a-classroom shortTitle: Teach -ms.openlocfilehash: 8d2c7eb41a233af9ef331ae30daf97387a80b522 -ms.sourcegitcommit: fb047f9450b41b24afc43d9512a5db2a2b750a2a +ms.openlocfilehash: 291aac6523c5df876e7e327aad962711cc82b003 +ms.sourcegitcommit: 82b1242de02ecc4bdec02a5b6d11568fb2deb1aa ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/11/2022 -ms.locfileid: '145097932' +ms.lasthandoff: 11/21/2022 +ms.locfileid: '148179744' --- diff --git a/translations/zh-CN/content/get-started/onboarding/getting-started-with-github-ae.md b/translations/zh-CN/content/get-started/onboarding/getting-started-with-github-ae.md index 0717b20b76..7a247d6c1c 100644 --- a/translations/zh-CN/content/get-started/onboarding/getting-started-with-github-ae.md +++ b/translations/zh-CN/content/get-started/onboarding/getting-started-with-github-ae.md @@ -19,7 +19,7 @@ You will first need to purchase {% data variables.product.product_name %}. For m After {% data variables.product.company_short %} creates the owner account for {% data variables.location.product_location %} on {% data variables.product.product_name %}, you will receive an email to sign in and complete the initialization. During initialization, you, as the enterprise owner, will name {% data variables.location.product_location %}, configure SAML SSO, create policies for all organizations in {% data variables.location.product_location %}, and configure a support contact for your enterprise members. For more information, see "[Initializing {% data variables.product.prodname_ghe_managed %}](/admin/configuration/configuring-your-enterprise/initializing-github-ae)." ### 3. Restricting network traffic -You can configure an allow list for specific IP addresses to restrict access to assets owned by organizations in your enterprise account. For more information, see "[Restricting network traffic to your enterprise](/admin/configuration/configuring-your-enterprise/restricting-network-traffic-to-your-enterprise)." +You can configure an allow list for specific IP addresses to restrict access to assets owned by organizations in your enterprise account. For more information, see "[Restricting network traffic to your enterprise with an IP allow list](/admin/configuration/configuring-your-enterprise/restricting-network-traffic-to-your-enterprise-with-an-ip-allow-list)." ### 4. Managing identity and access for {% data variables.location.product_location %} You can centrally manage access to {% data variables.location.product_location %} on {% data variables.product.product_name %} from an identity provider (IdP) using SAML single sign-on (SSO) for user authentication and System for Cross-domain Identity Management (SCIM) for user provisioning. Once you configure provisioning, you can assign or unassign users to the application from the IdP, creating or disabling user accounts in the enterprise. For more information, see "[About identity and access management for your enterprise](/admin/identity-and-access-management/managing-iam-for-your-enterprise/about-identity-and-access-management-for-your-enterprise)." diff --git a/translations/zh-CN/content/get-started/using-github/github-command-palette.md b/translations/zh-CN/content/get-started/using-github/github-command-palette.md index c169b3d97e..7dc354fc99 100644 --- a/translations/zh-CN/content/get-started/using-github/github-command-palette.md +++ b/translations/zh-CN/content/get-started/using-github/github-command-palette.md @@ -1,229 +1,234 @@ --- -title: GitHub Command Palette -intro: 'Use the command palette in {% data variables.product.product_name %} to navigate, search, and run commands directly from your keyboard.' +title: GitHub 命令面板 +intro: '使用 {% data variables.product.product_name %} 中的命令面板可以直接从键盘导航、搜索和运行命令。' versions: feature: command-palette shortTitle: GitHub Command Palette +ms.openlocfilehash: 5c6b739f2422be780cef6fa0e44e5d75663cc036 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159051' --- - {% data reusables.command-palette.beta-note %} -## About the {% data variables.product.prodname_command_palette %} +## 关于 {% data variables.product.prodname_command_palette %} -You can navigate, search, and run commands on {% data variables.product.product_name %} with the {% data variables.product.prodname_command_palette %}. The command palette is an on-demand way to show suggestions based on your current context and resources you've used recently. You can open the command palette with a keyboard shortcut from anywhere on {% data variables.product.product_name %}, which saves you time and keeps your hands on the keyboard. +您可以使用 {% data variables.product.prodname_command_palette %} 在 {% data variables.product.product_name %} 上导航、搜索和运行命令。 命令面板是一种按需方式,用于根据您最近使用的当前上下文和资源显示建议。 您可以从 {% data variables.product.product_name %} 上的任何位置使用键盘快捷键打开命令面板,这样可以节省您的时间,手也不需要离开键盘。 -### Fast navigation +### 快速导航 -When you open the command palette, the suggestions are optimized to give you easy access from anywhere in a repository, personal account, or organization to top-level pages like the Issues page. If the location you want isn't listed, start entering the name or number for the location to refine the suggestions. +打开命令面板时,建议会进行优化,使你可以从存储库、个人帐户或组织中的任意位置轻松访问顶级页面,如“问题”页面。 如果未列出所需的位置,请开始输入位置的名称或编号以优化建议。 -![Command palette repository suggestions](/assets/images/help/command-palette/command-palette-navigation-repo-default.png) +![命令面板存储库建议](/assets/images/help/command-palette/command-palette-navigation-repo-default.png) -### Easy access to commands +### 轻松访问命令 -The ability to run commands directly from your keyboard, without navigating through a series of menus, may change the way you use {% data variables.product.prodname_dotcom %}. For example, you can switch themes with a few keystrokes, making it easy to toggle between themes as your needs change. +直接从键盘运行命令而无需浏览一系列菜单的功能可能会改变您使用 {% data variables.product.prodname_dotcom %} 的方式。 例如,您可以通过几次击键切换主题,从而在需求变化时轻松切换主题。 -![Command palette change theme](/assets/images/help/command-palette/command-palette-command-change-theme.png) +![命令面板更改主题](/assets/images/help/command-palette/command-palette-command-change-theme.png) -## Opening the {% data variables.product.prodname_command_palette %} +## 打开 {% data variables.product.prodname_command_palette %} -Open the command palette using one of the following default keyboard shortcuts: -- Windows and Linux: Ctrl+K or Ctrl+Alt+K -- Mac: Command+K or Command+Option+K +使用以下默认键盘快捷键之一打开命令面板: +- Windows 和 Linux:Ctrl+KCtrl+Alt+K +- Mac:Command+KCommand+Option+K -You can customize the keyboard shortcuts you use to open the command palette in the [Accessibility section](https://github.com/settings/accessibility) of your user settings. For more information, see "[Customizing your {% data variables.product.prodname_command_palette %} keyboard shortcuts](#customizing-your-github-command-palette-keyboard-shortcuts)." +你可以在用户设置的[辅助功能部分](https://github.com/settings/accessibility)中自定义用于打开命令面板的键盘快捷方式。 有关详细信息,请参阅“[自定义 {% data variables.product.prodname_command_palette %} 键盘快捷方式](#customizing-your-github-command-palette-keyboard-shortcuts)”。 -When you open the command palette, it shows your location at the top left and uses it as the scope for suggestions (for example, the `mashed-avocado` organization). +打开命令面板时,它会在左上角显示你的位置,并将其用作建议的范围(例如 `mashed-avocado` 组织)。 -![Command palette launch](/assets/images/help/command-palette/command-palette-launch.png) +![命令面板启动](/assets/images/help/command-palette/command-palette-launch.png) {% note %} -**Notes:** -- If you are editing Markdown text, open the command palette with Ctrl+Alt+K (Windows and Linux) or Command+Option+K (Mac).{% ifversion projects-v2 %} -- If you are working on a {% data variables.projects.project_v2 %}, a project-specific command palette is displayed instead. For more information, see "[Customizing a view](/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/customizing-a-view)."{% endif %} +**注意:** +- 如果正在编辑 Markdown 文本,请使用 Ctrl+Alt+K(Windows 和 Linux)或 Command+Option+K (Mac) 打开命令面板。{% ifversion projects-v2 %} +- 如果正在处理 {% data variables.projects.project_v2 %},会改为显示项目特定的命令面板。 有关详细信息,请参阅“[自定义视图](/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/customizing-a-view)”。{% endif %} {% endnote %} -### Customizing your {% data variables.product.prodname_command_palette %} keyboard shortcuts +### 自定义 {% data variables.product.prodname_command_palette %} 键盘快捷键 -The default keyboard shortcuts used to open the command palette may conflict with your default OS and browser keyboard shortcuts. You have the option to customize your keyboard shortcuts in the [Accessibility section](https://github.com/settings/accessibility) of your account settings. In the command palette settings, you can customize the keyboard shortcuts for opening the command palette in both search mode and command mode. +用于打开命令面板的默认键盘快捷键可能与默认操作系统和浏览器键盘快捷键冲突。 你可以在帐户设置的[辅助功能部分](https://github.com/settings/accessibility)中自定义键盘快捷方式。 在命令面板设置中,可以自定义用于在搜索模式和命令模式下打开命令面板的键盘快捷键。 -![Command palette keyboard shortcut settings](/assets/images/help/command-palette/command-palette-keyboard-shortcut-settings.png) -## Navigating with the {% data variables.product.prodname_command_palette %} +![命令面板键盘快捷键设置](/assets/images/help/command-palette/command-palette-keyboard-shortcut-settings.png) +## 使用 {% data variables.product.prodname_command_palette %} 导航 -You can use the command palette to navigate to any page that you have access to on {% data variables.product.product_name %}. +可以使用命令面板导航到 {% data variables.product.product_name %} 上您有权访问的任何页面。 {% data reusables.command-palette.open-palette %} -2. Start typing the path you want to navigate to. The suggestions in the command palette change to match your text. +2. 开始键入要导航到的路径。 命令面板中的建议将更改以匹配您的文本。 - ![Command palette navigation current scope](/assets/images/help/command-palette/command-palette-navigation-current-scope.png) + ![命令面板导航当前范围](/assets/images/help/command-palette/command-palette-navigation-current-scope.png) {% data reusables.command-palette.change-scope %} - You can also use keystrokes to narrow your search. For more information, see "[Keystroke functions](#keystroke-functions)." + 您还可以使用按键来缩小搜索范围。 有关详细信息,请参阅“[按键功能](#keystroke-functions)”。 -4. Finish entering the path, or use the arrow keys to highlight the path you want from the list of suggestions. +4. 完成输入路径,或使用箭头键从建议列表中突出显示所需的路径。 -5. Use Enter to jump to your chosen location. Alternatively, use Ctrl+Enter (Windows and Linux) or Command+Enter (Mac) to open the location in a new browser tab. +5. 使用 Enter 跳转到所选位置。 或者,使用 Ctrl+Enter(Windows 和 Linux)或 Command+Enter (Mac) 在新的浏览器标签页中打开该位置。 -## Searching with the {% data variables.product.prodname_command_palette %} +## 使用 {% data variables.product.prodname_command_palette %} 搜索 -You can use the command palette to search for anything on {% data variables.location.product_location %}. +可以使用命令面板在 {% data variables.location.product_location %} 上搜索任何内容。 {% data reusables.command-palette.open-palette %} {% data reusables.command-palette.change-scope %} -3. Optionally, use keystrokes to find specific types of resource: +3. (可选)使用按键查找特定类型的资源: - - # Search for issues, pull requests, discussions, and projects - - ! Search for projects - - @ Search for users, organizations, and repositories - - / Search for files within a repository scope + - # 搜索问题、拉取请求、讨论和项目 + - ! 搜索项目 + - @ 搜索用户、组织和存储库 + - / 搜索存储库范围内的文件 - ![Command palette search files](/assets/images/help/command-palette/command-palette-search-files.png) + ![命令面板搜索文件](/assets/images/help/command-palette/command-palette-search-files.png) -4. Begin entering your search terms. The command palette will offer you a range of suggested searches based on your search scope. +4. 开始输入搜索字词。 命令面板将根据您的搜索范围为您提供一系列建议的搜索。 {% tip %} - You can also use the full syntax of {% data variables.product.prodname_dotcom %}'s integrated search within the command palette. For more information, see "[Searching for information on {% data variables.product.prodname_dotcom %}](/search-github)." + 你也可以在命令面板中使用 {% data variables.product.prodname_dotcom %} 集成搜索的完整语法。 有关详细信息,请参阅“[搜索有关 {% data variables.product.prodname_dotcom %} 的信息](/search-github)”。 {% endtip %} -5. Use the arrow keys to highlight the search result you want and use Enter to jump to your chosen location. Alternatively, use Ctrl+Enter (Windows and Linux) or Command+Enter (Mac) to open the location in a new browser tab. +5. 使用箭头键突出显示所需的搜索结果,并使用 Enter 跳转到所选位置。 或者,使用 Ctrl+Enter(Windows 和 Linux)或 Command+Enter (Mac) 在新的浏览器标签页中打开该位置。 -## Running commands from the {% data variables.product.prodname_command_palette %} +## 从 {% data variables.product.prodname_command_palette %} 运行命令 -You can use the {% data variables.product.prodname_command_palette %} to run commands. For example, you can create a new repository or issue, or change your theme. When you run a command, the location for its action is determined by either the underlying page or the scope shown in the command palette. +您可以使用 {% data variables.product.prodname_command_palette %} 来运行命令。 例如,您可以创建新的存储库或议题,或更改主题。 运行命令时,其操作的位置由基础页面或命令面板中显示的范围确定。 -- Pull request and issue commands always run on the underlying page. -- Higher-level commands, for example, repository commands, run in the scope shown in the command palette. +- 拉取请求和议题命令始终在基础页面上运行。 +- 更高级别的命令(例如存储库命令)在命令面板中显示的范围中运行。 -For a full list of supported commands, see "[{% data variables.product.prodname_command_palette %} reference](#github-command-palette-reference)." +有关受支持命令的完整列表,请参阅“[{% data variables.product.prodname_command_palette %} 参考](#github-command-palette-reference)”。 -1. The default keyboard shortcuts to open the command palette in command mode are Ctrl+Shift+K (Windows and Linux) or Command+Shift+K (Mac). If you already have the command palette open, press > to switch to command mode. {% data variables.product.prodname_dotcom %} suggests commands based on your location. +1. 在命令模式下打开命令面板的默认键盘快捷方式是 Ctrl+Shift+K(Windows 和 Linux)或 Command+Shift+K (Mac)。 如果已打开命令面板,请按 > 切换到命令模式。 {% data variables.product.prodname_dotcom %} 根据您的位置建议命令。 - ![Command palette command mode](/assets/images/help/command-palette/command-palette-command-mode.png) + ![命令面板命令模式](/assets/images/help/command-palette/command-palette-command-mode.png) {% data reusables.command-palette.change-scope %} -3. If the command you want is not displayed, check your scope then start entering the command name in the text box. +3. 如果未显示所需的命令,请检查范围,然后开始在文本框中输入命令名称。 -4. Use the arrow keys to highlight the command you want and use Enter to run it. +4. 使用箭头键突出显示所需的命令,然后使用 Enter 运行它。 -## Closing the command palette +## 关闭命令面板 -When the command palette is active, you can use one of the following keyboard shortcuts to close the command palette: +当命令面板处于活动状态时,可以使用以下键盘快捷键之一关闭命令面板: -- Search and navigation mode: Esc or Ctrl+K (Windows and Linux) Command+K (Mac) -- Command mode: Esc or Ctrl+Shift+K (Windows and Linux) Command+Shift+K (Mac) +- 搜索和导航模式:EscCtrl+K(Windows 和 Linux)或 Command+K (Mac) +- 命令模式:EscCtrl+Shift+K(Windows 和 Linux)或 Command+Shift+K (Mac) -If you have customized the command palette keyboard shortcuts in the Accessibility settings, your customized keyboard shortcuts will be used for both opening and closing the command palette. +如果在辅助功能设置中自定义了命令面板键盘快捷键,则自定义的键盘快捷键将用于打开和关闭命令面板。 -## {% data variables.product.prodname_command_palette %} reference +## {% data variables.product.prodname_command_palette %} 引用 -### Keystroke functions +### 按键功能 -These keystrokes are available when the command palette is in navigation and search modes, that is, they are not available in command mode. +当命令面板处于导航和搜索模式时,这些按键可用,也就是说,它们在命令模式下不可用。 -| Keystroke | Function | +| 击键 | 函数 | | :- | :- | -|>| Enter command mode. For more information, see "[Running commands from the {% data variables.product.prodname_command_palette %}](#running-commands-from-the-github-command-palette)." | -|#| Search for issues, pull requests, discussions, and projects. For more information, see "[Searching with the {% data variables.product.prodname_command_palette %}](#searching-with-the-github-command-palette)."| -|@| Search for users, organizations, and repositories. For more information, see "[Searching with the {% data variables.product.prodname_command_palette %}](#searching-with-the-github-command-palette)."| -|/| Search for files within a repository scope or repositories within an organization scope. For more information, see "[Searching with the {% data variables.product.prodname_command_palette %}](#searching-with-the-github-command-palette)." | -|!| Search just for projects. For more information, see "[Searching with the {% data variables.product.prodname_command_palette %}](#searching-with-the-github-command-palette)."| -|Ctrl+C or Command+C| Copy the search or navigation URL for the highlighted result to the clipboard.| -|Enter| Jump to the highlighted result or run the highlighted command.| -|Ctrl+Enter or Command+Enter| Open the highlighted search or navigation result in a new brower tab.| -|?| Display help within the command palette.| +|>| 进入命令模式。 有关详细信息,请参阅“[从 {% data variables.product.prodname_command_palette %} 运行命令](#running-commands-from-the-github-command-palette)”。 | +|#| 搜索议题、拉取请求、讨论和项目。 有关详细信息,请参阅“[使用 {% data variables.product.prodname_command_palette %} 搜索](#searching-with-the-github-command-palette)”。| +|@| 搜索用户、组织和存储库。 有关详细信息,请参阅“[使用 {% data variables.product.prodname_command_palette %} 搜索](#searching-with-the-github-command-palette)”。| +|/| 搜索存储库范围内的文件或组织范围内的存储库。 有关详细信息,请参阅“[使用 {% data variables.product.prodname_command_palette %} 搜索](#searching-with-the-github-command-palette)”。 | +|!| 只搜索项目。 有关详细信息,请参阅“[使用 {% data variables.product.prodname_command_palette %} 搜索](#searching-with-the-github-command-palette)”。| +|Ctrl+CCommand+C| 将突出显示结果的搜索或导航 URL 复制到剪贴板。| +|Enter| 跳转到突出显示的结果或运行突出显示的命令。| +|Ctrl+EnterCommand+Enter| 在新的浏览器选项卡中打开突出显示的搜索或导航结果。| +|?| 在命令面板中显示帮助。| -### Global commands +### 全局命令 -These commands are available from all scopes. +以下命令可从所有范围使用。 -| Command | Behavior| +| Command | 行为| | :- | :- | :- | -|`Import repository`|Create a new repository by importing a project from another version control system. For more information, see "[Importing a repository with GitHub importer](/get-started/importing-your-projects-to-github/importing-source-code-to-github/importing-a-repository-with-github-importer)." | -|`New gist`|Open a new gist. For more information, see "[Creating a gist](/get-started/writing-on-github/editing-and-sharing-content-with-gists/creating-gists)." | -|`New organization`|Create a new organization. For more information, see "[Creating a new organization from scratch](/organizations/collaborating-with-groups-in-organizations/creating-a-new-organization-from-scratch)." | -|`New project`|Create a new project board. For more information, see "[Creating a project](/issues/planning-and-tracking-with-projects/creating-projects/creating-a-project)." | -|`New repository`|Create a new repository from scratch. For more information, see "[Creating a new repository](/repositories/creating-and-managing-repositories/creating-a-new-repository)." | -|`Switch theme to `|Change directly to a different theme for the UI. For more information, see "[Managing your theme settings](/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-personal-account-settings/managing-your-theme-settings)." | +|`Import repository`|通过从另一个版本控制系统导入项目来创建新存储库。 有关详细信息,请参阅“[使用 GitHub 导入工具导入存储库](/get-started/importing-your-projects-to-github/importing-source-code-to-github/importing-a-repository-with-github-importer)”。 | +|`New gist`|打开新 gist。 有关详细信息,请参阅“[创建 Gist](/get-started/writing-on-github/editing-and-sharing-content-with-gists/creating-gists)”。 | +|`New organization`|创建新组织。 有关详细信息,请参阅“[从头开始创建新组织](/organizations/collaborating-with-groups-in-organizations/creating-a-new-organization-from-scratch)”。 | +|`New project`|创建新的项目板。 有关详细信息,请参阅“[创建项目](/issues/planning-and-tracking-with-projects/creating-projects/creating-a-project)”。 | +|`New repository`|从头开始创建新的存储库。 有关详细信息,请参阅“[创建新存储库](/repositories/creating-and-managing-repositories/creating-a-new-repository)”。 | +|`Switch theme to `|直接更改为 UI 的其他主题。 有关详细信息,请参阅“[管理主题设置](/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-personal-account-settings/managing-your-theme-settings)”。 | -### Organization commands +### 组织命令 -These commands are available only within the scope of an organization. +以下命令仅在组织的范围内可用。 -| Command | Behavior| +| Command | 行为| | :- | :- | -| `New team`| Create a new team in the current organization. For more information, see "[Creating a team](/organizations/organizing-members-into-teams/creating-a-team)." +| `New team`| 在当前组织中创建新团队。 有关详细信息,请参阅“[创建团队](/organizations/organizing-members-into-teams/creating-a-team)”。 -### Repository commands +### 存储库命令 -Most of these commands are available only on the home page of the repository. If a command is also available on other pages, this is noted in the behavior column. +这些命令中的大多数仅在存储库的主页上可用。 如果某个命令在其他页面上也可用,则会在行为列中注明。 -| Command | Behavior| +| Command | 行为| | :- | :- | -|`Clone repository: `|Copy the URL needed to clone the repository using {% data variables.product.prodname_cli %}, HTTPS, or SSH to the clipboard. For more information, see "[Cloning a repository](/repositories/creating-and-managing-repositories/cloning-a-repository)."| -|`New discussion`|Create a new discussion in the repository. For more information, see "[Creating a new discussion](/discussions/quickstart#creating-a-new-discussion)."| -|`New file`|Create a new file from any page in the repository. For more information, see "[Adding a file to a repository](/repositories/working-with-files/managing-files/adding-a-file-to-a-repository)." -|`New issue`|Open a new issue from any page in the repository. For more information, see "[Creating an issue](/issues/tracking-your-work-with-issues/creating-an-issue)."| -|`Open in new codespace`|Create and open a codespace for this repository. For more information, see "[Creating a codespace for a repository](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository)."| -|`Open in github.dev editor`|Open the current repository in the github.dev editor. For more information, see "[Opening the web based editor](/codespaces/the-githubdev-web-based-editor#opening-the-web-based-editor)."| +|`Clone repository: `|将使用 {% data variables.product.prodname_cli %}、HTTPS 或 SSH 克隆存储库所需的 URL 复制到剪贴板。 有关详细信息,请参阅“[克隆存储库](/repositories/creating-and-managing-repositories/cloning-a-repository)”。| +|`New discussion`|在存储库中创建新讨论。 有关详细信息,请参阅“[创建新讨论](/discussions/quickstart#creating-a-new-discussion)”。| +|`New file`|从存储库中的任何页面创建新文件。 有关详细信息,请参阅“[将文件添加到存储库](/repositories/working-with-files/managing-files/adding-a-file-to-a-repository)”。 +|`New issue`|从存储库中的任何页面打开新议题。 有关详细信息,请参阅“[创建问题](/issues/tracking-your-work-with-issues/creating-an-issue)”。| +|`Open in new codespace`|为此存储库创建并打开代码空间。 有关详细信息,请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository)”。| +|`Open in github.dev editor`|在 github.dev 编辑器中打开当前存储库。 有关详细信息,请参阅“[打开基于 Web 的编辑器](/codespaces/the-githubdev-web-based-editor#opening-the-web-based-editor)”。| -### File commands +### 文件命令 -These commands are available only when you open the command palette from a file in a repository. +以下命令仅当您从存储库中的文件打开命令面板时才可用。 -| Command | Behavior| +| Command | 行为| | :- | :- | -|`Copy permalink`|Create a link to the file that includes the current commit SHA and copy the link to the clipboard. For more information, see "[Getting permanent links to files](/repositories/working-with-files/using-files/getting-permanent-links-to-files#press-y-to-permalink-to-a-file-in-a-specific-commit)." -|`Open in github.dev editor`|Open the currently displayed file in github.dev editor. For more information, see "[Opening the web based editor](/codespaces/the-githubdev-web-based-editor#opening-the-web-based-editor)."| +|`Copy permalink`|创建指向包含当前提交 SHA 的文件的链接,并将该链接复制到剪贴板。 有关详细信息,请参阅“[获取文件的永久链接](/repositories/working-with-files/using-files/getting-permanent-links-to-files#press-y-to-permalink-to-a-file-in-a-specific-commit)”。 +|`Open in github.dev editor`|在 github.dev 编辑器中打开当前显示的文件。 有关详细信息,请参阅“[打开基于 Web 的编辑器](/codespaces/the-githubdev-web-based-editor#opening-the-web-based-editor)”。| -### Discussion commands +### 讨论命令 -These commands are available only when you open the command palette from a discussion. They act on your current page and are not affected by the scope set in the command palette. +以下命令仅当您从讨论中打开命令面板时才可用。 它们作用于当前页面,不受命令面板中设置的范围的影响。 -| Command | Behavior| +| Command | 行为| | :- | :- | -|`Delete discussion...`|Permanently delete the discussion. For more information, see "[Managing discussions](/discussions/managing-discussions-for-your-community/managing-discussions#deleting-a-discussion)." -|`Edit discussion body`|Open the main body of the discussion ready for editing. -|`Subscribe`/`unsubscribe`|Opt in or out of notifications for additions to the discussion. For more information, see "[About notifications](/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/about-notifications)." -|`Transfer discussion...`|Move the discussion to a different repository. For more information, see "[Managing discussions](/discussions/managing-discussions-for-your-community/managing-discussions#transferring-a-discussion)." +|`Delete discussion...`|永久删除讨论。 有关详细信息,请参阅“[管理讨论](/discussions/managing-discussions-for-your-community/managing-discussions#deleting-a-discussion)”。 +|`Edit discussion body`|打开讨论的正文以供编辑。 +|`Subscribe`/`unsubscribe`|选择接收或不接收有关讨论内容增加的通知。 有关详细信息,请参阅“[关于通知](/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/about-notifications)”。 +|`Transfer discussion...`|将讨论移动到其他存储库。 有关详细信息,请参阅“[管理讨论](/discussions/managing-discussions-for-your-community/managing-discussions#transferring-a-discussion)”。 -### Issue commands +### 议题命令 -These commands are available only when you open the command palette from an issue. They act on your current page and are not affected by the scope set in the command palette. +以下命令仅当您从议题中打开命令面板时才可用。 它们作用于当前页面,不受命令面板中设置的范围的影响。 -| Command | Behavior| +| Command | 行为| | :- | :- | -|`Close`/`reopen issue`|Close or reopen the current issue. For more information, see "[About issues](/issues/tracking-your-work-with-issues/about-issues)."| -|`Convert issue to discussion...`|Convert the current issue into a discussion. For more information, see "[Moderating discussions](/discussions/managing-discussions-for-your-community/moderating-discussions#converting-an-issue-to-a-discussion)." -|`Delete issue...`|Delete the current issue. For more information, see "[Deleting an issue](/issues/tracking-your-work-with-issues/deleting-an-issue)."| -|`Edit issue body`|Open the main body of the issue ready for editing. -|`Edit issue title`|Open the title of the issue ready for editing. -|`Lock issue`|Limit new comments to users with write access to the repository. For more information, see "[Locking conversations](/communities/moderating-comments-and-conversations/locking-conversations)." -|`Pin`/`unpin issue`|Change whether or not the issue is shown in the pinned issues section for the repository. For more information, see "[Pinning an issue to your repository](/issues/tracking-your-work-with-issues/pinning-an-issue-to-your-repository)."| -|`Subscribe`/`unsubscribe`|Opt in or out of notifications for changes to this issue. For more information, see "[About notifications](/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/about-notifications)." -|`Transfer issue...`|Transfer the issue to another repository. For more information, see "[Transferring an issue to another repository](/issues/tracking-your-work-with-issues/transferring-an-issue-to-another-repository)."| +|`Close`/`reopen issue`|关闭或重新打开当前议题。 有关详细信息,请参阅“[关于问题](/issues/tracking-your-work-with-issues/about-issues)”。| +|`Convert issue to discussion...`|将当前议题转换为讨论。 有关详细信息,请参阅“[审查讨论](/discussions/managing-discussions-for-your-community/moderating-discussions#converting-an-issue-to-a-discussion)”。 +|`Delete issue...`|删除当前议题。 有关详细信息,请参阅“[删除问题](/issues/tracking-your-work-with-issues/deleting-an-issue)”。| +|`Edit issue body`|打开议题正文以进行编辑。 +|`Edit issue title`|打开议题的标题以进行编辑。 +|`Lock issue`|将新评论限于对存储库具有写入访问权限的用户。 有关详细信息,请参阅“[锁定对话](/communities/moderating-comments-and-conversations/locking-conversations)”。 +|`Pin`/`unpin issue`|更改议题是否显示在存储库的固定议题部分中。 有关详细信息,请参阅“[将问题固定到存储库](/issues/tracking-your-work-with-issues/pinning-an-issue-to-your-repository)”。| +|`Subscribe`/`unsubscribe`|选择接收或不接收有关此议题更改的通知。 有关详细信息,请参阅“[关于通知](/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/about-notifications)”。 +|`Transfer issue...`|将议题转移到另一个存储库。 有关详细信息,请参阅“[将问题转移到其他存储库](/issues/tracking-your-work-with-issues/transferring-an-issue-to-another-repository)”。| -### Pull request commands +### 拉取请求命令 -These commands are available only when you open the command palette from a pull request. They act on your current page and are not affected by the scope set in the command palette. +以下命令仅当您从拉取请求打开命令面板时才可用。 它们作用于当前页面,不受命令面板中设置的范围的影响。 -| Command | Behavior| +| Command | 行为| | :- | :- | -|`Close`/`reopen pull request`|Close or reopen the current pull request. For more information, see "[About pull requests](/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)."| -|`Convert to draft`/`Mark pull request as ready for review`|Change the state of the pull request to show it as ready, or not ready, for review. For more information, see "[Changing the state of a pull request](/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request)."| -|`Copy current branch name`| Add the name of the head branch for the pull request to the clipboard. -|`Edit pull request body`|Open the main body of the pull request ready for editing. -|`Edit pull request title`|Open the title of the pull request ready for editing. -|`Open in new codespace`|Create and open a codespace for the head branch of the pull request. For more information, see "[Creating a codespace for a repository](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository)." -|`Subscribe`/`unsubscribe`|Opt in or out of notifications for changes to this pull request. For more information, see "[About notifications](/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/about-notifications)." -|`Update current branch`|Update the head branch of the pull request with changes from the base branch. This is available only for pull requests that target the default branch of the repository. For more information, see "[About branches](/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches)."| +|`Close`/`reopen pull request`|关闭或重新打开当前拉取请求。 有关详细信息,请参阅“[关于拉取请求](/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)”。| +|`Convert to draft`/`Mark pull request as ready for review`|更改拉取请求的状态,以将其显示为就绪或未准备好以供审阅。 有关详细信息,请参阅“[更改拉取请求的状态](/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request)”。| +|`Copy current branch name`| 将拉取请求的头部分支的名称添加到剪贴板。 +|`Edit pull request body`|打开拉取请求的正文以进行编辑。 +|`Edit pull request title`|打开拉取请求的标题以进行编辑。 +|`Open in new codespace`|为拉取请求的头部分支创建并打开代码空间。 有关详细信息,请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository)”。 +|`Subscribe`/`unsubscribe`|选择接收或不接收有关此拉取请求更改的通知。 有关详细信息,请参阅“[关于通知](/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/about-notifications)”。 +|`Update current branch`|使用来自基础分支的更改更新拉取请求的头部分支。 这仅适用于以存储库的默认分支为目标的拉取请求。 有关详细信息,请参阅“[关于分支](/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches)”。| diff --git a/translations/zh-CN/content/get-started/using-github/keyboard-shortcuts.md b/translations/zh-CN/content/get-started/using-github/keyboard-shortcuts.md index 416cf4f6d1..86dec80403 100644 --- a/translations/zh-CN/content/get-started/using-github/keyboard-shortcuts.md +++ b/translations/zh-CN/content/get-started/using-github/keyboard-shortcuts.md @@ -21,10 +21,11 @@ Typing ? on {% data variables.product.prodname_dotcom %} brings up a {% ifversion keyboard-shortcut-accessibility-setting %} You can disable character key shortcuts, while still allowing shortcuts that use modifier keys, in your accessibility settings. For more information, see "[Managing accessibility settings](/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-personal-account-settings/managing-accessibility-settings)."{% endif %} -Below is a list of some of the available keyboard shortcuts. {% ifversion command-palette %} The {% data variables.product.prodname_command_palette %} also gives you quick access to a wide range of actions, without the need to remember keyboard shortcuts. For more information, see "[{% data variables.product.prodname_command_palette %}](/get-started/using-github/github-command-palette)."{% endif %} +The following sections list some of the available keyboard shortcuts, organized by the pages where you can use them on {% data variables.location.product_location %}. + ## Site wide shortcuts | Keyboard shortcut | Description @@ -130,16 +131,14 @@ For more keyboard shortcuts, see the [CodeMirror documentation](https://codemirr |Shift and click | When creating an issue from a task list, open the new issue form in a new tab by holding Shift and clicking the {% octicon "issue-opened" aria-label="The issue opened icon" %} in the upper-right corner of the task. For more information, see "[About task lists](/issues/tracking-your-work-with-issues/creating-issues/about-task-lists)." |Command and click (Mac) or
Ctrl+Shift and click (Windows/Linux) | When creating an issue from a task list, open the new issue form in the new window by holding Command or Ctrl+Shift and clicking the {% octicon "issue-opened" aria-label="The issue opened icon" %} in the upper-right corner of the task. For more information, see "[About task lists](/issues/tracking-your-work-with-issues/creating-issues/about-task-lists)."{% endif %} -## Changes in pull requests +## "Files changed" tab in pull requests | Keyboard shortcut | Description |-----------|------------ -|C | Open the list of commits in the pull request -|T | Open the list of changed files in the pull request -|J | Move selection down in the list -|K | Move selection up in the list -|Command+Shift+Enter | Add a single comment on a pull request diff | -|Alt and click | Toggle between collapsing and expanding all outdated review comments in a pull request by holding down Alt and clicking **Show outdated** or **Hide outdated**.| +|C | Open the **Commits** dropdown menu to filter which commits are shown in the diffs +|T | Move your cursor to the "Filter changed files" field +|Command+Shift+Enter (Mac) or Ctrl+Shift+Enter (Windows/Linux) | Submit a review comment | +|Option and click (Mac) or Alt and click (Windows/Linux) | Toggle between collapsing and expanding all outdated or resolved review comments in a pull request (for example, by holding down Alt and clicking **Show outdated** or **Hide outdated**) | |Click, then Shift and click | Comment on multiple lines of a pull request by clicking a line number, holding Shift, then clicking another line number. For more information, see "[Commenting on a pull request](/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)."| {% ifversion projects-v2 %} diff --git a/translations/zh-CN/content/get-started/writing-on-github/working-with-advanced-formatting/about-task-lists.md b/translations/zh-CN/content/get-started/writing-on-github/working-with-advanced-formatting/about-task-lists.md new file mode 100644 index 0000000000..2b4495efc3 --- /dev/null +++ b/translations/zh-CN/content/get-started/writing-on-github/working-with-advanced-formatting/about-task-lists.md @@ -0,0 +1,81 @@ +--- +title: About task lists +intro: 'You can use task lists to break the work for an issue or pull request into smaller tasks, then track the full set of work to completion.' +redirect_from: + - /github/managing-your-work-on-github/managing-your-work-with-issues-and-pull-requests/about-task-lists + - /articles/about-task-lists + - /github/managing-your-work-on-github/about-task-lists + - /issues/tracking-your-work-with-issues/creating-issues/about-task-lists + - /issues/tracking-your-work-with-issues/about-task-lists +versions: + fpt: '*' + ghes: '*' + ghae: '*' + ghec: '*' +topics: + - Pull requests + - Issues +--- + +{% ifversion projects-v2-tasklists %} +{% note %} + +**Note:** For more information about the new iteration of Tasklists, which is currently in a private beta, see "[About Tasklists](/issues/tracking-your-work-with-issues/about-tasklists)." + +{% endnote %} +{% endif %} + +## About task lists + +A task list is a set of tasks that each render on a separate line with a clickable checkbox. You can select or deselect the checkboxes to mark the tasks as complete or incomplete. + +You can use Markdown to create a task list in any comment on {% data variables.product.product_name %}. {% ifversion fpt or ghec %}If you reference an issue, pull request, or discussion in a task list, the reference will unfurl to show the title and state.{% endif %} + +{% ifversion not fpt or ghec %} +You can view task list summary information in issue and pull request lists, when the task list is in the initial comment. +{% else %} + +## About issue task lists + +If you add a task list to the body of an issue, the list has added functionality. + +- To help you track your team's work on an issue, the progress of an issue's task list appears in various places on {% data variables.product.product_name %}, such as a repository's list of issues. +- If a task references another issue and someone closes that issue, the task's checkbox will automatically be marked as complete. +- If a task requires further tracking or discussion, you can convert the task to an issue by hovering over the task and clicking {% octicon "issue-opened" aria-label="The issue opened icon" %} in the upper-right corner of the task. To add more details before creating the issue, you can use keyboard shortcuts to open the new issue form. For more information, see "[Keyboard shortcuts](/github/getting-started-with-github/using-github/keyboard-shortcuts#issues-and-pull-requests)." +- Any issues referenced in the task list will specify that they are tracked in the referencing issue. + +![Rendered task list](/assets/images/help/writing/task-list-rendered.png) + +{% endif %} + +## Creating task lists + +{% data reusables.repositories.task-list-markdown %} + +{% tip %} + +**Tip:** You cannot create task list items within closed issues or issues with linked pull requests. + +{% endtip %} + +## Reordering tasks + +You can reorder the items in a task list by clicking to the left of a task's checkbox, dragging the task to a new location, and dropping the task. You can reorder tasks across different lists in the same comment, but you can not reorder tasks across different comments. + +{% ifversion fpt %} ![Reordered task list](/assets/images/help/writing/task-list-reordered.gif) +{% else %} ![Reordered task list](/assets/images/enterprise/writing/task-lists-reorder.gif) {% endif %} + +{% ifversion fpt %} + +## Navigating tracked issues + +Any issues that are referenced in a task list specify that they are tracked by the issue that contains the task list. To navigate to the tracking issue from the tracked issue, click on the tracking issue number in the **Tracked in** section next to the issue status. + +![Tracked in example](/assets/images/help/writing/task_list_tracked.png) + +{% endif %} + +## Further reading + +{% ifversion code-scanning-task-lists %} +* "[Tracking {% data variables.product.prodname_code_scanning %} alerts in issues using task lists](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/tracking-code-scanning-alerts-in-issues-using-task-lists)"{% endif %} diff --git a/translations/zh-CN/content/issues/planning-and-tracking-with-projects/automating-your-project/using-the-api-to-manage-projects.md b/translations/zh-CN/content/issues/planning-and-tracking-with-projects/automating-your-project/using-the-api-to-manage-projects.md index 62df133894..b2ca2ac793 100644 --- a/translations/zh-CN/content/issues/planning-and-tracking-with-projects/automating-your-project/using-the-api-to-manage-projects.md +++ b/translations/zh-CN/content/issues/planning-and-tracking-with-projects/automating-your-project/using-the-api-to-manage-projects.md @@ -11,12 +11,12 @@ type: tutorial topics: - Projects allowTitleToDifferFromFilename: true -ms.openlocfilehash: 6b4deff4ee518bfdafcd3886577a1c9b12ea7b2e -ms.sourcegitcommit: bf11c3e08cbb5eab6320e0de35b32ade6d863c03 +ms.openlocfilehash: ab041e8473e310913eb1b794302415e9b6323e76 +ms.sourcegitcommit: e4069b5613c10d74954185995d0fb73224079463 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 10/27/2022 -ms.locfileid: '148111599' +ms.lasthandoff: 11/17/2022 +ms.locfileid: '148169230' --- 本文演示如何使用 GraphQL API 来管理项目。 有关如何在 {% data variables.product.prodname_actions %} 工作流中使用 API 的详细信息,请参阅“[使用 Actions 自动执行 {% data variables.product.prodname_projects_v2 %}](/issues/planning-and-tracking-with-projects/automating-your-project/automating-projects-using-actions)”。 有关可用数据类型的完整列表,请参阅“[参考](/graphql/reference)”。 @@ -665,7 +665,7 @@ gh api graphql -f query=' curl --request POST \ --url https://api.github.com/graphql \ --header 'Authorization: Bearer TOKEN' \ - --data '{"query":"mutation {updateProjectV2ItemFieldValue( input: { projectId: \"PROJECT_ID\" itemId: \"ITEM_ID\" fieldId: \"FIELD_ID\" value: { singleSelectOptionId: \"OPTION_ID\" }}) { projectV2Item { id }}}"}' + --data '{"query":"mutation {updateProjectV2ItemFieldValue( input: { projectId: \"PROJECT_ID\" itemId: \"ITEM_ID\" fieldId: \"FIELD_ID\" value: { iterationId: \"ITERATION_ID\" }}) { projectV2Item { id }}}"}' ``` {% endcurl %} diff --git a/translations/zh-CN/content/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects.md b/translations/zh-CN/content/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects.md index d28319b816..d789cb81cf 100644 --- a/translations/zh-CN/content/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects.md +++ b/translations/zh-CN/content/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects.md @@ -10,12 +10,12 @@ type: tutorial topics: - Projects allowTitleToDifferFromFilename: true -ms.openlocfilehash: b1c04738a3c03d892b360c3b23def694d202ee0c -ms.sourcegitcommit: f638d569cd4f0dd6d0fb967818267992c0499110 +ms.openlocfilehash: 680d6cff10dfc063ebaef0ebc9f8f7d0c15ba2e7 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 10/25/2022 -ms.locfileid: '148108097' +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158939' --- 可使用筛选器和按项目中的字段来自定义项目元数据的视图,例如代理人和应用于问题的标签。 可以合并筛选并将其保存为视图。 有关详细信息,请参阅“[自定义项目视图](/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/customizing-a-view)”。 @@ -25,6 +25,8 @@ ms.locfileid: '148108097' 对于使用 {% data variables.product.prodname_projects_v2 %} 的见解创建的图表,可使用相同的筛选器来筛选用于创建图表的数据。 有关详细信息,请参阅“[将见解用于项目](/issues/planning-and-tracking-with-projects/viewing-insights-from-your-project/about-insights-for-projects)”。 +筛选视图并添加项时,筛选后的元数据将应用到添加的项。 例如,如果将筛选条件设置为 `status:"In progress"`,并添加项,则新项的状态将设置为“正在进行”。 + ## 过滤项 点击表格顶部的 {% octicon "filter" aria-label="the filter icon" %} 以显示“Filter by keyword or by field(按关键字或字段过滤)”列。 开始键入要过滤的字段名称和值。 当您输入时,可能的值将会出现。 diff --git a/translations/zh-CN/content/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects.md b/translations/zh-CN/content/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects.md index 2b8dd52bd8..5369787570 100644 --- a/translations/zh-CN/content/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects.md +++ b/translations/zh-CN/content/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects.md @@ -1,6 +1,6 @@ --- -title: 'About {% data variables.product.prodname_projects_v2 %}' -intro: '{% data variables.product.prodname_projects_v2 %} is an adaptable, flexible tool for planning and tracking work on {% data variables.product.company_short %}.' +title: '关于 {% data variables.product.prodname_projects_v2 %}' +intro: '{% data variables.product.prodname_projects_v2 %} 是一个适应性强的灵活工具,用于计划和跟踪 {% data variables.product.company_short %} 上的工作。' allowTitleToDifferFromFilename: true miniTocMaxHeadingLevel: 3 versions: @@ -10,52 +10,57 @@ redirect_from: type: overview topics: - Projects +ms.openlocfilehash: 768234aa5e6c9cfbca6a6144a80ac2868f3316ce +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158859' --- +## 关于 {% data variables.product.prodname_projects_v2 %} -## About {% data variables.product.prodname_projects_v2 %} +项目是一个适应性强的电子表格,可与你在 {% data variables.product.company_short %} 上的问题和拉取求集成来帮助你有效地计划和跟踪工作。 可通过以下方式创建和自定义多个视图:对问题和拉取请求进行筛选、排序和分组;添加自定义字段来跟踪特定于团队的元数据;使用可配置图表直观呈现工作。 项目提供灵活的功能而不是强制实施特定方法,你可根据团队的需求和流程对这些灵活功能进行自定义。 -A project is an adaptable spreadsheet that integrates with your issues and pull requests on {% data variables.product.company_short %} to help you plan and track your work effectively. You can create and customize multiple views by filtering, sorting, grouping your issues and pull requests, adding custom fields to track metadata specific to your team, and visualize work with configurable charts. Rather than enforcing a specific methodology, a project provides flexible features you can customize to your team’s needs and processes. +### 保持最新 -### Staying up-to-date +项目是根据你添加的问题和拉取请求生成的,在项目与工作之间创建了直接引用。 当你进行更改、更新视图和图表时,信息会自动同步到项目。 此集成也双向运行,因此当你更改有关项目中拉取请求或问题的信息时,拉取请求或问题会反映该信息。 例如,更改项目中的代理人,该更改将显示在问题中。 可进一步进行此集成,按代理人对项目进行分组,并通过将问题拖动到不同的组中来更改问题分配。 -Your projects are built from the issues and pull requests you add, creating direct references between your project and your work. Information is synced automatically to your project as you make changes, updating your views and charts. This integration works both ways, so that when you change information about a pull request or issue in your project, the pull request or issue reflects that information. For example, change an assignee in your project and that change is shown in your issue. You can take this integration even further, group your project by assignee, and make changes to issue assignment by dragging issues into the different groups. +### 添加元数据到项目 -### Adding metadata to your items +可使用自定义字段向问题、拉取请求和草稿问题添加元数据,并生成更丰富的项属性视图。 可添加的元数据并不局限于当前针对问题和拉取请求而存在的内置元数据(代理人、里程碑、标签等)。 例如,可以将以下元数据添加为自定义字段: -You can use custom fields to add metadata to your issues, pull requests, and draft issues and build a richer view of item attributes. You’re not limited to the built-in metadata (assignee, milestone, labels, etc.) that currently exists for issues and pull requests. For example, you can add the following metadata as custom fields: - -- A date field to track target ship dates. -- A number field to track the complexity of a task. -- A single select field to track whether a task is Low, Medium, or High priority. -- A text field to add a quick note. -- An iteration field to plan work week-by-week, including support for breaks. +- 用于跟踪目标发货日期的日期字段。 +- 用于跟踪任务复杂性的数字字段。 +- 用于跟踪任务是“低”、“中等”还是“高”优先级的单个选择字段。 +- 用于添加快速笔记的文本字段。 +- 用于计划每周工作(包括对中断的支持)的迭代字段。 {% ifversion projects-v2-tasklists %} -### Exploring the relationships between issues +### 探索问题之间的关系 {% data reusables.projects.tasklists-release-stage %} -You can use Tasklists to build hierarchies of issues, dividing your issues into smaller subtasks, and creating new relationships between your issues. For more information, see "[About Tasklists](/issues/tracking-your-work-with-issues/about-tasklists)." +可以使用任务列表功能构建问题的层次结构,将问题划分为较小的子任务,并在问题之间创建新关系。 有关详细信息,请参阅“[关于任务列表](/issues/tracking-your-work-with-issues/about-tasklists)”。 -These relationships are displayed on the issue, as well as the Tracked-by and Tracks fields in your projects. You can filter by issues which are tracked by another issue, and you can also group your table views by the Tracked-by field to show all parent issues with a list of their subtasks. +这些关系体现在问题以及项目中的“跟踪者”和“跟踪”字段中。 可以按其他问题跟踪的问题进行筛选,还可以按“跟踪者”字段对表视图进行分组,以显示所有父问题及其子任务列表。 {% endif %} -### Viewing your project from different perspectives +### 从不同的角度查看您的项目 -Quickly answer your most pressing questions by tailoring your project view to give you the information you need. You can save these views, allowing you to quickly return to them as needed and make them available to your team. Views not only let you scope down the items listed but also offer two different layout options. +通过调整项目视图来提供所需信息,快速回答最紧迫的问题。 可保存这些视图,以便根据需要快速返回到这些视图,并使它们可供团队使用。 视图不仅使你可以缩小所列项的范围,还提供两个不同的布局选项。 -You can view your project as a high density table layout: +您可以将您的项目视为高密度表布局: -![Project table](/assets/images/help/issues/projects_table.png) +![项目表](/assets/images/help/issues/projects_table.png) -Or as a board: +或作为板: -![Project board](/assets/images/help/issues/projects_board.png) +![项目板](/assets/images/help/issues/projects_board.png) -To help you focus on specific aspects of your project, you can group, sort, or filter items: +为了帮助您专注于项目的特定方面,您可以对项目进行分组、排序或筛选: -![Project view](/assets/images/help/issues/project_view.png) +![项目视图](/assets/images/help/issues/project_view.png) -For more information, see "[Customizing a view](/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/customizing-a-view)." +有关详细信息,请参阅“[自定义视图](/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/customizing-a-view)”。 diff --git a/translations/zh-CN/content/issues/planning-and-tracking-with-projects/understanding-fields/about-tracks-and-tracked-by-fields.md b/translations/zh-CN/content/issues/planning-and-tracking-with-projects/understanding-fields/about-tracks-and-tracked-by-fields.md new file mode 100644 index 0000000000..ce5dc7a1b5 --- /dev/null +++ b/translations/zh-CN/content/issues/planning-and-tracking-with-projects/understanding-fields/about-tracks-and-tracked-by-fields.md @@ -0,0 +1,56 @@ +--- +title: 关于“跟踪”和“跟踪依据”字段 +shortTitle: About Tracks and Tracked-by fields +intro: 可以查看项目中问题的子任务。 +miniTocMaxHeadingLevel: 3 +versions: + feature: projects-v2-tasklists +type: tutorial +topics: + - Projects +ms.openlocfilehash: 74cd26d20882a00ac8c7ac1d109cc6810286cec6 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159469' +--- +{% data reusables.projects.tasklists-release-stage %} + +可以在项目上启用“跟踪”和“跟踪依据”字段,以便在任务列表中添加子任务时查看问题之间的关系。 有关在任务列表中创建问题层次结构的详细信息,请参阅“[关于任务列表](/issues/tracking-your-work-with-issues/about-tasklists)”。 + +“跟踪依据”字段可用于对项目进行分组,从而创建一个视图,清楚地显示每个问题的子任务以及完成这些任务所需的工作。 有关详细信息,请参阅“[按表格布局中的字段值分组](/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/customizing-a-view#grouping-by-field-values-in-table-layout)”。 + +还可以按“跟踪依据”字段进行筛选,以仅显示按特定问题跟踪的项目。 开始键入“tracked-by”并从列表中选择一个问题,或者,如果知道存储库和问题编号,则可以完整键入下面的筛选器。 + +``` +tracked-by:"/#" +``` + +若要使用筛选器,请将 `` 替换为存储库所有者,将 `` 替换为存储库名称,并将 `` 替换为问题编号。 有关详细信息,请参阅“[筛选项目](/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects)”。 + +### 启用“跟踪依据”字段 + +可以启用“跟踪依据”字段以查看哪些问题正在跟踪项目中的项。 + +1. 在表视图中,单击最右侧字段标题中的 {% octicon "plus" aria-label="the plus icon" %}。 + + ![显示“新建字段”按钮的屏幕截图](/assets/images/help/projects-v2/new-field-button.png) + +1. 在“隐藏字段”下,单击“跟踪依据”。 + + ![显示字段菜单的屏幕截图](/assets/images/help/projects-v2/select-tracked-by-field.png) + + +### 启用“跟踪”字段 + +可以启用“跟踪”字段以查看项目中的项正在跟踪的其他问题。 + +1. 在表视图中,单击最右侧字段标题中的 {% octicon "plus" aria-label="the plus icon" %}。 + + ![显示“新建字段”按钮的屏幕截图](/assets/images/help/projects-v2/new-field-button.png) + +1. 在“隐藏的字段”下,单击“跟踪”。 + + ![显示字段菜单的屏幕截图](/assets/images/help/projects-v2/select-tracks-field.png) + diff --git a/translations/zh-CN/content/issues/planning-and-tracking-with-projects/understanding-fields/deleting-custom-fields.md b/translations/zh-CN/content/issues/planning-and-tracking-with-projects/understanding-fields/deleting-custom-fields.md new file mode 100644 index 0000000000..9ecb0c132c --- /dev/null +++ b/translations/zh-CN/content/issues/planning-and-tracking-with-projects/understanding-fields/deleting-custom-fields.md @@ -0,0 +1,25 @@ +--- +title: 删除自定义字段 +intro: '了解如何从 {% data variables.projects.project_v2 %} 中删除自定义字段。' +miniTocMaxHeadingLevel: 3 +versions: + feature: projects-v2 +type: tutorial +topics: + - Projects +redirect_from: + - /issues/planning-and-tracking-with-projects/understanding-field-types/deleting-fields +ms.openlocfilehash: b4a0c070b92b3b28c684c9e3b2f7388b9d7b517a +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159417' +--- +{% data reusables.projects.project-settings %} +1. 单击要删除的自定义字段的名称。 + ![显示迭代字段的屏幕截图](/assets/images/help/projects-v2/select-single-select.png) +1. 在字段名称旁边,单击 {% octicon "kebab-horizontal" aria-label="The menu icon" %} 以打开菜单。 + ![显示字段名称的屏幕截图](/assets/images/help/projects-v2/field-options.png) +1. 单击“删除字段”。 + ![显示字段名称的屏幕截图](/assets/images/help/projects-v2/delete-field.png) diff --git a/translations/zh-CN/content/issues/planning-and-tracking-with-projects/understanding-fields/index.md b/translations/zh-CN/content/issues/planning-and-tracking-with-projects/understanding-fields/index.md new file mode 100644 index 0000000000..7f55384518 --- /dev/null +++ b/translations/zh-CN/content/issues/planning-and-tracking-with-projects/understanding-fields/index.md @@ -0,0 +1,28 @@ +--- +title: 了解字段 +shortTitle: Understanding fields +intro: 了解不同的字段和自定义字段类型、如何将字段添加到项目以及如何管理自定义字段。 +versions: + feature: projects-v2 +topics: + - Issues + - Projects +children: + - /about-text-and-number-fields + - /about-date-fields + - /about-single-select-fields + - /about-iteration-fields + - /about-tracks-and-tracked-by-fields + - /renaming-custom-fields + - /deleting-custom-fields +allowTitleToDifferFromFilename: true +redirect_from: + - /issues/planning-and-tracking-with-projects/understanding-field-types +ms.openlocfilehash: ed15d18adff2e51c6f5d9ce41f4af701f71354ed +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159468' +--- + diff --git a/translations/zh-CN/content/issues/planning-and-tracking-with-projects/understanding-fields/renaming-custom-fields.md b/translations/zh-CN/content/issues/planning-and-tracking-with-projects/understanding-fields/renaming-custom-fields.md new file mode 100644 index 0000000000..b7c2e2da1e --- /dev/null +++ b/translations/zh-CN/content/issues/planning-and-tracking-with-projects/understanding-fields/renaming-custom-fields.md @@ -0,0 +1,24 @@ +--- +title: 重命名自定义字段 +intro: '了解如何重命名 {% data variables.projects.project_v2 %} 中的现有自定义字段。' +miniTocMaxHeadingLevel: 3 +versions: + feature: projects-v2 +type: tutorial +topics: + - Projects +redirect_from: + - /issues/planning-and-tracking-with-projects/understanding-field-types/renaming-fields +ms.openlocfilehash: 45520fab579af228685443e0aa9ab563289325f1 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159510' +--- +{% data reusables.projects.project-settings %} +1. 单击要重命名的自定义字段的名称。 + ![迭代字段的屏幕截图](/assets/images/help/projects-v2/select-single-select.png) +1. 在“字段名称”下,键入字段的新名称。 + ![显示字段名称的屏幕截图](/assets/images/help/projects-v2/field-rename.png) +1. 若要保存更改,请按 Return。 diff --git a/translations/zh-CN/content/issues/planning-and-tracking-with-projects/viewing-insights-from-your-project/about-insights-for-projects.md b/translations/zh-CN/content/issues/planning-and-tracking-with-projects/viewing-insights-from-your-project/about-insights-for-projects.md index 7d92b09750..d746fa77b0 100644 --- a/translations/zh-CN/content/issues/planning-and-tracking-with-projects/viewing-insights-from-your-project/about-insights-for-projects.md +++ b/translations/zh-CN/content/issues/planning-and-tracking-with-projects/viewing-insights-from-your-project/about-insights-for-projects.md @@ -11,12 +11,12 @@ product: '{% data reusables.gated-features.historical-insights-for-projects %}' topics: - Projects allowTitleToDifferFromFilename: true -ms.openlocfilehash: 89f93ace53547fccd69ffb7e6d7b666a6cb48991 -ms.sourcegitcommit: f638d569cd4f0dd6d0fb967818267992c0499110 +ms.openlocfilehash: 809d8492bb1ec7c8cd4eb051b1eaefb00d29097e +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 10/25/2022 -ms.locfileid: '148108120' +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158571' --- {% ifversion fpt %} @@ -30,6 +30,8 @@ ms.locfileid: '148108120' 可以使用 {% data variables.product.prodname_projects_v2 %} 的见解来查看、创建和自定义使用添加到项目中的项作为其源数据的图表。 可以向该默认图表应用筛选器,也可以创建自己的图表。 创建图表时,可以设置筛选器、图表类型和显示的信息,并且任何可以查看项目的人都可以使用该图表。 可以生成两种类型的图表:当前图表和历史图表。 + 见解会跟踪已存档或删除的项。 + ### 关于当前图表 可以创建当前图表来对项目项进行可视化。 例如,可以创建图表来显示分配给每个人的项数,或分配给每个即将发生的迭代的问题数。 diff --git a/translations/zh-CN/content/issues/tracking-your-work-with-issues/about-tasklists.md b/translations/zh-CN/content/issues/tracking-your-work-with-issues/about-tasklists.md new file mode 100644 index 0000000000..67aa5cbcd1 --- /dev/null +++ b/translations/zh-CN/content/issues/tracking-your-work-with-issues/about-tasklists.md @@ -0,0 +1,146 @@ +--- +title: 关于任务列表 +intro: 可使用任务列表将问题划分为更小的子任务。 +versions: + feature: projects-v2-tasklists +miniTocMaxHeadingLevel: 3 +redirect_from: + - /early-access/issues/about-tasklists +ms.openlocfilehash: e35065ae4de634bb7a2da815e0a860c7c0b92234 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159494' +--- +{% data reusables.projects.tasklists-release-stage %} + +## 关于任务列表 + +任务列表添加了对 {% data variables.product.product_name %} 上的问题层次结构的支持,从而帮助跟踪问题,将问题划分为更小的子任务,并在问题之间创建新的关系。 + +任务列表建立在 [beta 版本任务列表](/get-started/writing-on-github/working-with-advanced-formatting/about-task-lists)的先前迭代基础之上,保留了将项转换为问题、显示任务列表进度以及在问题之间创建“跟踪/跟踪者”关系的功能。 + +将自动填充添加到任务列表的问题,以显示其被分配者和应用的任何标签。 + +![显示正在运行的任务列表的图像](/assets/images/help/issues/tasklist-hero.png) + +### 关于与 {% data variables.projects.projects_v2 %} 的集成 + + 项目的侧面板在痕迹菜单的层次结构中显示问题的位置,使你可以浏览任务列表中包含的问题。 还可以将“跟踪”和“跟踪者”字段添加到项目视图中,以快速查看问题之间的关系。 有关信息,请参阅“[关于跟踪和跟踪者字段](/issues/planning-and-tracking-with-projects/understanding-fields/about-tracks-and-tracked-by-fields)”。 + +## 创建任务列表 + +要创建任务列表,可使用“添加任务列表”按钮或编辑问题 Markdown。 + +### 使用“添加任务列表”按钮创建任务列表 + +单击任何问题描述底部的“{% octicon "checklist" aria-label="The checklist icon" %} 添加任务列表”按钮,可对其进行编辑以创建任务列表。 + +![显示“添加任务列表”按钮的屏幕截图](/assets/images/help/issues/tasklist-add-tasklist-button.png) + +### 使用 Markdown 创建任务列表 + +可以在问题描述中使用 Markdown 来创建任务列表。 创建围栏代码块,并在右反引号旁边添加 `[tasklist]`。 在每个项前面加上 `- [ ]`,并添加指向其他问题或文本的链接。 可以有选择性地在列表顶部添加一个标题作为 Markdown 标头。 + +```` +```[tasklist] +### Tasks +- [ ] https://github.com/octo-org/octo-repo/issues/45 +- [ ] Draft issue title +``` +```` + +Markdown 将由 {% data variables.product.product_name %} 以任务列表的形式呈现。 然后,可使用 UI 进行更改并添加问题和草稿问题。 如果编辑问题描述,你将能够直接修改 Markdown 或复制 Markdown 以复制其他问题中的任务列表。 + + + +## 将问题添加到任务列表 + +1. 在“任务列表”底部,单击“将项添加到任务”。 + + ![显示“将项添加到任务”按钮的屏幕截图](/assets/images/help/issues/add-new-tasklist-button.png) + +1. 选择要添加到任务列表的问题。 + + * 要从存储库添加最近更新的问题,请单击下拉列表中的问题,或使用箭头键将其选中,然后按 Enter。 + + ![显示最近问题的屏幕截图](/assets/images/help/issues/select-recent-issue.png) + + * 要在存储库中搜索问题,请开始键入问题的标题或问题的编号,然后单击结果,或使用箭头键将其选中并按 Enter。 + + ![显示搜索问题的屏幕截图](/assets/images/help/issues/search-for-issue.png) + + * 要使用问题 URL 直接添加问题,请粘贴问题的 URL,然后按 Enter。 + + ![显示粘贴的问题 URL 的屏幕截图](/assets/images/help/issues/paste-issue-url.png) + + +## 在任务列表中创建草稿问题 + +草稿问题有助于快速捕获以后可以转换为问题的想法。 与从存储库引用的问题和拉取请求不同,草稿问题只存在于你的任务列表中。 + +1. 在“任务列表”底部,单击“将项添加到任务”。 + + ![显示“将项添加到任务”按钮的屏幕截图](/assets/images/help/issues/add-new-tasklist-button.png) + +1. 输入草稿问题标题,然后按 Enter。 + + ![显示草稿问题标题的屏幕截图](/assets/images/help/issues/add-draft-issue-to-tasklist.png) + + +## 将草稿问题转换为任务列表中的问题 + +可以将草稿问题转换为问题。 问题是在任务列表的父问题所在的同一存储库中创建的。 + +1. 在要转换的草稿问题旁边,单击 {% octicon "kebab-horizontal" aria-label="The kebab menu icon" %}。 + + ![显示菜单图标的屏幕截图](/assets/images/help/issues/tasklist-item-kebab.png) + +1. 在菜单中,单击“转换为问题”。 + + ![“转换为问题”选项的屏幕截图](/assets/images/help/issues/tasklist-convert-to-issue.png) + + +## 从任务列表中删除某个问题或草稿问题 + +可以从任务列表中删除问题和草稿问题。 从任务列表中删除的问题不会从存储库中删除。 + +1. 在要删除的草稿问题旁边,单击 {% octicon "kebab-horizontal" aria-label="The kebab menu icon" %}。 + + ![显示菜单图标的屏幕截图](/assets/images/help/issues/tasklist-item-kebab.png) + +1. 在菜单中,单击“删除”。 + + ![显示“删除”选项的屏幕截图](/assets/images/help/issues/tasklist-remove.png) + +## 更改任务列表的标题 + +创建新任务列表时,默认标题为“任务”。 可通过编辑问题的 Markdown 来修改标题。 + +1. 在问题正文的右上角,单击 {% octicon "kebab-horizontal" aria-label="The kebab menu icon" %}。 + + ![显示菜单图标位置的屏幕截图](/assets/images/help/issues/comment-menu.png) + +1. 在菜单上,单击“编辑”。 + + ![显示“编辑”选项的屏幕截图](/assets/images/help/issues/comment-menu-edit.png) + +1. 将防护代码块中的标题修改为新标题。 例如,将 `### Tasks` 更改为 `### My new title`。 + + ![显示“编辑”选项的屏幕截图](/assets/images/help/issues/edit-tasklist-title.png) + +1. 单击“更新评论”。 + +## 复制任务列表 + +当使用“复制 Markdown”选项复制任务列表时,{% data variables.product.product_name %} 会将 Markdown 复制到剪贴板并添加问题的名称,这样可以将任务列表粘贴到 GitHub 之外而不会丢失上下文。 + +1. 在任务列表的右上角,单击 {% octicon "kebab-horizontal" aria-label="The kebab menu icon" %}。 + + ![显示菜单图标的屏幕截图](/assets/images/help/issues/tasklist-kebab.png) + +1. 在菜单中,单击“复制 Markdown”。 + + ![显示“复制 Markdown”选项的屏幕截图](/assets/images/help/issues/tasklist-copy-markdown.png) + diff --git a/translations/zh-CN/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization.md b/translations/zh-CN/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization.md index 6e405c1b91..859f0341a9 100644 --- a/translations/zh-CN/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization.md +++ b/translations/zh-CN/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization.md @@ -1,6 +1,6 @@ --- -title: 管理组织允许的 IP 地址 -intro: 可以通过配置允许连接的 IP 地址列表来限制对组织专用资产的访问。 +title: Managing allowed IP addresses for your organization +intro: You can restrict access to your organization's private assets by configuring a list of IP addresses that are allowed to connect. redirect_from: - /github/setting-up-and-managing-organizations-and-teams/managing-allowed-ip-addresses-for-your-organization - /organizations/keeping-your-organization-secure/managing-allowed-ip-addresses-for-your-organization @@ -12,82 +12,100 @@ topics: - Teams shortTitle: Manage allowed IP addresses permissions: Organization owners can manage allowed IP addresses for an organization. -ms.openlocfilehash: 5d0a9bbc9b2207e088e2051025a8844e7cf0dbec -ms.sourcegitcommit: 478f2931167988096ae6478a257f492ecaa11794 -ms.translationtype: HT -ms.contentlocale: zh-CN -ms.lasthandoff: 09/09/2022 -ms.locfileid: '147707297' --- -## 关于允许的 IP 地址 -可通过为特定 IP 地址配置允许列表来限制对专用组织资产的访问。 {% data reusables.identity-and-permissions.ip-allow-lists-example-and-restrictions %} +## About allowed IP addresses -{% ifversion ghec %} {% note %} +You can restrict access to private organization assets by configuring an allow list for specific IP addresses. {% data reusables.identity-and-permissions.ip-allow-lists-example-and-restrictions %} -注意:只有使用 {% data variables.product.prodname_ghe_cloud %} 的组织才能使用 IP 允许列表。 {% data reusables.enterprise.link-to-ghec-trial %} +{% ifversion ghec %} +{% note %} -{% endnote %} {% endif %} +**Note:** Only organizations that use {% data variables.product.prodname_ghe_cloud %} can use IP allow lists. {% data reusables.enterprise.link-to-ghec-trial %} + +{% endnote %} +{% endif %} {% data reusables.identity-and-permissions.ip-allow-lists-cidr-notation %} {% data reusables.identity-and-permissions.ip-allow-lists-enable %} -如果您设置了允许列表,您还可以选择将为组织中安装的 {% data variables.product.prodname_github_apps %} 配置的任何 IP 地址自动添加到允许列表中。 {% data variables.product.prodname_github_app %} 的创建者可以为其应用程序配置允许列表,指定应用程序运行的 IP 地址。 通过将允许列表继承到您的列表中,您可以避免申请中的连接请求被拒绝。 有关详细信息,请参阅“[允许 {% data variables.product.prodname_github_apps %} 进行访问](#allowing-access-by-github-apps)”。 +If you set up an allow list you can also choose to automatically add to your allow list any IP addresses configured for {% data variables.product.prodname_github_apps %} that you install in your organization. The creator of a {% data variables.product.prodname_github_app %} can configure an allow list for their application, specifying the IP addresses at which the application runs. By inheriting their allow list into yours, you avoid connection requests from the application being refused. For more information, see "[Allowing access by {% data variables.product.prodname_github_apps %}](#allowing-access-by-github-apps)." -您还可以为企业帐户中的组织配置允许的 IP 地址。 有关详细信息,请参阅“[为企业中的安全设置强制实施策略](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-security-settings-in-your-enterprise#managing-allowed-ip-addresses-for-organizations-in-your-enterprise)”。 +You can also configure allowed IP addresses for the organizations in an enterprise account. For more information, see "[Enforcing policies for security settings in your enterprise](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-security-settings-in-your-enterprise#managing-allowed-ip-addresses-for-organizations-in-your-enterprise)." -## 添加允许的 IP 地址 +## Adding an allowed IP address {% data reusables.identity-and-permissions.about-adding-ip-allow-list-entries %} {% data reusables.identity-and-permissions.ipv6-allow-lists %} -{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} {% data reusables.organizations.security %} {% data reusables.identity-and-permissions.ip-allow-lists-add-ip %} {% data reusables.identity-and-permissions.ip-allow-lists-add-description %} {% data reusables.identity-and-permissions.ip-allow-lists-add-entry %} {% data reusables.identity-and-permissions.check-ip-address %} +{% data reusables.profile.access_org %} +{% data reusables.profile.org_settings %} +{% data reusables.organizations.security %} +{% data reusables.identity-and-permissions.ip-allow-lists-add-ip %} +{% data reusables.identity-and-permissions.ip-allow-lists-add-description %} +{% data reusables.identity-and-permissions.ip-allow-lists-add-entry %} +{% data reusables.identity-and-permissions.check-ip-address %} -## 启用允许的 IP 地址 +## Enabling allowed IP addresses {% data reusables.identity-and-permissions.about-enabling-allowed-ip-addresses %} -{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} {% data reusables.organizations.security %} -1. 在“IP 允许列表”下,选择“启用 IP 允许列表”。 - ![允许 IP 地址的复选框](/assets/images/help/security/enable-ip-allowlist-organization-checkbox.png) -1. 单击“ **保存**”。 +{% data reusables.profile.access_org %} +{% data reusables.profile.org_settings %} +{% data reusables.organizations.security %} +1. Under "IP allow list", select **Enable IP allow list**. + ![Checkbox to allow IP addresses](/assets/images/help/security/enable-ip-allowlist-organization-checkbox.png) +1. Click **Save**. -## 允许 {% data variables.product.prodname_github_apps %} 访问 +## Allowing access by {% data variables.product.prodname_github_apps %} -如果您设置允许列表,您还可以选择将为组织中安装的 {% data variables.product.prodname_github_apps %} 配置的任何 IP 地址自动添加到允许列表中。 +If you're using an allow list, you can also choose to automatically add to your allow list any IP addresses configured for {% data variables.product.prodname_github_apps %} that you install in your organization. {% data reusables.identity-and-permissions.ip-allow-lists-address-inheritance %} {% data reusables.apps.ip-allow-list-only-apps %} -若要详细了解如何为已创建的 {% data variables.product.prodname_github_app %} 创建允许列表,请参阅“[管理 GitHub 应用的允许 IP 地址](/developers/apps/building-github-apps/managing-allowed-ip-addresses-for-a-github-app)”。 +For more information about how to create an allow list for a {% data variables.product.prodname_github_app %} you have created, see "[Managing allowed IP addresses for a GitHub App](/developers/apps/building-github-apps/managing-allowed-ip-addresses-for-a-github-app)." -{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} {% data reusables.organizations.security %} -1. 在“IP 允许列表”下,选择“为已安装的 GitHub 应用启用 IP 允许列表配置”。 - ![允许 GitHub 应用 IP 地址的复选框](/assets/images/help/security/enable-ip-allowlist-githubapps-checkbox.png) -1. 单击“ **保存**”。 +{% data reusables.profile.access_org %} +{% data reusables.profile.org_settings %} +{% data reusables.organizations.security %} +1. Under "IP allow list", select **Enable IP allow list configuration for installed GitHub Apps**. + ![Checkbox to allow GitHub App IP addresses](/assets/images/help/security/enable-ip-allowlist-githubapps-checkbox.png) +1. Click **Save**. -## 编辑允许的 IP 地址 +## Editing an allowed IP address {% data reusables.identity-and-permissions.about-editing-ip-allow-list-entries %} -{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} {% data reusables.organizations.security %} {% data reusables.identity-and-permissions.ip-allow-lists-edit-entry %} {% data reusables.identity-and-permissions.ip-allow-lists-edit-ip %} {% data reusables.identity-and-permissions.ip-allow-lists-edit-description %} -1. 单击“更新”。 +{% data reusables.profile.access_org %} +{% data reusables.profile.org_settings %} +{% data reusables.organizations.security %} +{% data reusables.identity-and-permissions.ip-allow-lists-edit-entry %} +{% data reusables.identity-and-permissions.ip-allow-lists-edit-ip %} +{% data reusables.identity-and-permissions.ip-allow-lists-edit-description %} +1. Click **Update**. {% data reusables.identity-and-permissions.check-ip-address %} -{% ifversion ip-allow-list-address-check %} -## 检查是否允许使用 IP 地址 +## Checking if an IP address is permitted {% data reusables.identity-and-permissions.about-checking-ip-address %} -{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} {% data reusables.organizations.security %} {% data reusables.identity-and-permissions.check-ip-address-step %} {% endif %} +{% data reusables.profile.access_org %} +{% data reusables.profile.org_settings %} +{% data reusables.organizations.security %} +{% data reusables.identity-and-permissions.check-ip-address-step %} -## 删除允许的 IP 地址 +## Deleting an allowed IP address -{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} {% data reusables.organizations.security %} {% data reusables.identity-and-permissions.ip-allow-lists-delete-entry %} {% data reusables.identity-and-permissions.ip-allow-lists-confirm-deletion %} +{% data reusables.profile.access_org %} +{% data reusables.profile.org_settings %} +{% data reusables.organizations.security %} +{% data reusables.identity-and-permissions.ip-allow-lists-delete-entry %} +{% data reusables.identity-and-permissions.ip-allow-lists-confirm-deletion %} -## 对 {% data variables.product.prodname_actions %} 使用 IP 允许列表 +## Using {% data variables.product.prodname_actions %} with an IP allow list {% data reusables.actions.ip-allow-list-self-hosted-runners %} diff --git a/translations/zh-CN/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/reviewing-the-audit-log-for-your-organization.md b/translations/zh-CN/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/reviewing-the-audit-log-for-your-organization.md index ddcbcd53d1..743dcf7071 100644 --- a/translations/zh-CN/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/reviewing-the-audit-log-for-your-organization.md +++ b/translations/zh-CN/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/reviewing-the-audit-log-for-your-organization.md @@ -486,8 +486,9 @@ For more information, see "[Managing the publication of {% data variables.produc | `oauth_app_access_approved` | Triggered when an owner [grants organization access to an {% data variables.product.prodname_oauth_app %}](/articles/approving-oauth-apps-for-your-organization/). | `oauth_app_access_denied` | Triggered when an owner [disables a previously approved {% data variables.product.prodname_oauth_app %}'s access](/articles/denying-access-to-a-previously-approved-oauth-app-for-your-organization) to your organization. | `oauth_app_access_requested` | Triggered when an organization member requests that an owner grant an {% data variables.product.prodname_oauth_app %} access to your organization.{% endif %} -{% ifversion ghec %} -| `org.transfer` | Triggered when an organization is transferred between enterprise accounts. For more information, see "[Transferring an organization between enterprise accounts](/admin/user-management/managing-organizations-in-your-enterprise/adding-organizations-to-your-enterprise#transferring-an-organization-between-enterprise-accounts)."{% endif %} +{%- ifversion ghec %} +| `org.transfer` | Triggered when an organization is transferred between enterprise accounts. For more information, see "[Transferring an organization between enterprise accounts](/admin/user-management/managing-organizations-in-your-enterprise/adding-organizations-to-your-enterprise#transferring-an-organization-between-enterprise-accounts)." +{%- endif %} | `register_self_hosted_runner` | Triggered when a new self-hosted runner is registered. For more information, see "[Adding a self-hosted runner to an organization](/actions/hosting-your-own-runners/adding-self-hosted-runners#adding-a-self-hosted-runner-to-an-organization)." | `remove_actions_secret` | Triggered when a {% data variables.product.prodname_actions %} secret is removed.{% ifversion fpt or ghec %} | `remove_billing_manager` | Triggered when an [owner removes a billing manager from an organization](/articles/removing-a-billing-manager-from-your-organization/) or when [two-factor authentication is required in an organization](/articles/requiring-two-factor-authentication-in-your-organization) and a billing manager doesn't use 2FA or disables 2FA. |{% endif %} diff --git a/translations/zh-CN/content/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization.md b/translations/zh-CN/content/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization.md index 6c34866ebd..f78282764f 100644 --- a/translations/zh-CN/content/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization.md +++ b/translations/zh-CN/content/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization.md @@ -15,12 +15,12 @@ topics: - Organizations - Teams shortTitle: Roles in an organization -ms.openlocfilehash: 960f6f701ad524220e9e79ada04fa9e4d30b8e9f -ms.sourcegitcommit: f638d569cd4f0dd6d0fb967818267992c0499110 +ms.openlocfilehash: c6c345e3d1f0fb2c49aa55e79346bc4ac6567885 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 10/25/2022 -ms.locfileid: '148108023' +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159171' --- ## 关于角色 {% data reusables.organizations.about-roles %} diff --git a/translations/zh-CN/content/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks.md b/translations/zh-CN/content/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks.md index d167d9caa8..5bf015ab94 100644 --- a/translations/zh-CN/content/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks.md +++ b/translations/zh-CN/content/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks.md @@ -1,6 +1,6 @@ --- -title: About forks -intro: A fork is a copy of a repository that you manage. Forks let you make changes to a project without affecting the original repository. You can fetch updates from or submit changes to the original repository with pull requests. +title: 关于分叉 +intro: 复刻是您管理的仓库的副本。 复刻用于更改项目而不影响原始仓库。 您可以通过拉取请求从原始仓库提取更新,或者提交更改到原始仓库。 redirect_from: - /github/collaborating-with-issues-and-pull-requests/working-with-forks/about-forks - /articles/about-forks @@ -13,33 +13,39 @@ versions: ghec: '*' topics: - Pull requests +ms.openlocfilehash: 83372d27f052ee8c22730f5ce5d22e9efbf04fbb +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148158747' --- -Forking a repository is similar to copying a repository, with two major differences: +复刻仓库类似于复制仓库,主要有两点差异: -* You can use a pull request to suggest changes from your user-owned fork to the original repository in its GitHub instance, also known as the *upstream* repository. -* You can bring changes from the upstream repository to your local fork by synchronizing your fork with the upstream repository. +* 可以使用拉取请求来建议从用户拥有的分支到其 GitHub 实例中的原始存储库(也称为“上游”存储库)的更改。 +* 您可以通过同步复刻与上游仓库,将更改从上游仓库提交到本地复刻。 {% data reusables.repositories.you-can-fork %} {% ifversion fpt or ghec %} -If you're a member of an {% data variables.enterprise.prodname_emu_enterprise %}, there are further restrictions on the repositories you can fork. {% data reusables.enterprise-accounts.emu-forks %} For more information, see "[About {% data variables.product.prodname_emus %}](/enterprise-cloud@latest/admin/authentication/managing-your-enterprise-users-with-your-identity-provider/about-enterprise-managed-users){% ifversion fpt %}" in the {% data variables.product.prodname_ghe_cloud %} documentation.{% else %}."{% endif %} +如果你是 {% data variables.enterprise.prodname_emu_enterprise %} 的成员,则对可以创建分支的存储库有更多的限制。 {% data reusables.enterprise-accounts.emu-forks %} 有关详细信息,请参阅 {% data variables.product.prodname_ghe_cloud %} 文档中的“[关于 {% data variables.product.prodname_emus %}](/enterprise-cloud@latest/admin/authentication/managing-your-enterprise-users-with-your-identity-provider/about-enterprise-managed-users){% ifversion fpt %}”。{% else %}."{% endif %} {% endif %} {% data reusables.repositories.desktop-fork %} -Deleting a fork will not delete the original upstream repository. You can make any changes you want to your fork—add collaborators, rename files, generate {% data variables.product.prodname_pages %}—with no effect on the original.{% ifversion fpt or ghec %} You cannot restore a deleted forked repository. For more information, see "[Restoring a deleted repository](/articles/restoring-a-deleted-repository)."{% endif %} +删除复刻不会删除原始上游仓库。 可以对分支进行任何所需的更改(添加协作者、重命名文件、生成 {% data variables.product.prodname_pages %}),而不影响原始版本。{% ifversion fpt or ghec %} 无法还原已删除的分支存储库。 有关详细信息,请参阅“[还原已删除的存储库](/articles/restoring-a-deleted-repository)”。{% endif %} -In open source projects, forks are often used to iterate on ideas or changes before they are offered back to the upstream repository. When you make changes in your user-owned fork and open a pull request that compares your work to the upstream repository, you can give anyone with push access to the upstream repository permission to push changes to your pull request branch (including deleting the branch). This speeds up collaboration by allowing repository maintainers the ability to make commits or run tests locally to your pull request branch from a user-owned fork before merging. You cannot give push permissions to a fork owned by an organization. +在开源项目中,复刻常用于迭代想法或更改,然后将其提交回上游仓库。 在用户拥有的复刻中进行更改,然后打开拉取请求以比较您的工作与上游仓库,便可允许对上游仓库具有推送权限的任何推送更改到拉取请求分支(包括删除分支)。 这可加速协作,让仓库维护员在合并之前于本地从用户拥有的复刻对拉取请求进行提交或运行测试。 不可向组织拥有的复刻授予推送权限。 {% data reusables.repositories.private_forks_inherit_permissions %} -If you want to create a new repository from the contents of an existing repository but don't want to merge your changes to the upstream in the future, you can duplicate the repository or, if the repository is a template, you can use the repository as a template. For more information, see "[Duplicating a repository](/articles/duplicating-a-repository)" and "[Creating a repository from a template](/articles/creating-a-repository-from-a-template)". +如果以后要从现有仓库的内容创建新仓库,但不想合并上游更改,您可以复制仓库 ,或者,如果该仓库是模板,您可以使用该仓库作为模板。 有关详细信息,请参阅“[复制存储库](/articles/duplicating-a-repository)”和“[从模板创建存储库](/articles/creating-a-repository-from-a-template)”。 -## Further reading +## 延伸阅读 -- "[About collaborative development models](/pull-requests/collaborating-with-pull-requests/getting-started/about-collaborative-development-models)" -- "[Creating a pull request from a fork](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)" -- [Open Source Guides](https://opensource.guide/){% ifversion fpt or ghec %} +- “[关于协作开发模型](/pull-requests/collaborating-with-pull-requests/getting-started/about-collaborative-development-models)” +- “[从分支创建拉取请求](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)” +- [开源指南](https://opensource.guide/){% ifversion fpt or ghec %} - [{% data variables.product.prodname_learning %}]({% data variables.product.prodname_learning_link %}){% endif %} diff --git a/translations/zh-CN/content/rest/overview/libraries.md b/translations/zh-CN/content/rest/overview/libraries.md index 9e9662f967..2343f97de5 100644 --- a/translations/zh-CN/content/rest/overview/libraries.md +++ b/translations/zh-CN/content/rest/overview/libraries.md @@ -11,12 +11,12 @@ versions: ghec: '*' topics: - API -ms.openlocfilehash: aa139c0d25354260ccf688079f3e15a871b627bd -ms.sourcegitcommit: 0ed77777360ec29eee7cd4fc212ae36fdd97c0bc +ms.openlocfilehash: 4560ae5e63f8a607f068bb24e84f1a014f44885c +ms.sourcegitcommit: 82b1242de02ecc4bdec02a5b6d11568fb2deb1aa ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 11/11/2022 -ms.locfileid: '148160960' +ms.lasthandoff: 11/21/2022 +ms.locfileid: '148179734' --- ![Gundamcat](/assets/images/gundamcat.png) @@ -35,7 +35,7 @@ ms.locfileid: '148160960' | 库名称 | 存储库 | |---|---| -|Tentacles| [Raynes/tentacles](https://github.com/Raynes/tentacles)| +|Tentacles| [Raynes/tentacles](https://github.com/clj-commons/tentacles)| ### Dart diff --git a/translations/zh-CN/content/search-github/getting-started-with-searching-on-github/about-searching-on-github.md b/translations/zh-CN/content/search-github/getting-started-with-searching-on-github/about-searching-on-github.md index 86af4520c6..fe8ca14f50 100644 --- a/translations/zh-CN/content/search-github/getting-started-with-searching-on-github/about-searching-on-github.md +++ b/translations/zh-CN/content/search-github/getting-started-with-searching-on-github/about-searching-on-github.md @@ -1,6 +1,6 @@ --- -title: About searching on GitHub -intro: 'Our integrated search covers the many repositories, users, and lines of code on {% data variables.product.product_name %}.' +title: 关于在 GitHub 上搜索 +intro: '我们的集成搜索涵盖了 {% data variables.product.product_name %} 上的许多仓库、用户和代码行。' redirect_from: - /articles/using-the-command-bar - /articles/github-search-basics @@ -17,79 +17,82 @@ versions: ghec: '*' topics: - GitHub search +ms.openlocfilehash: 58ecec218d8f8f0ee3d11afbf65debf7df72e811 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159099' --- +{% ifversion github-code-search %} {% note %} -{% ifversion github-code-search %} - {% note %} + 注意:{% data reusables.search.classic-search-code-search-note %} - **Note:** {% data reusables.search.classic-search-code-search-note %} - - {% endnote %} -{% endif %} + {% endnote %} {% endif %} {% data reusables.search.you-can-search-globally %} -- To search globally across all of {% data variables.product.product_name %}, type what you're looking for into the search field at the top of any page, and choose "All {% data variables.product.prodname_dotcom %}" in the search drop-down menu. -- To search within a particular repository or organization, navigate to the repository or organization page, type what you're looking for into the search field at the top of the page, and press **Enter**. +- 要全局搜索所有 {% data variables.product.product_name %},请在页面顶部的搜索字段中输入您要查找的内容,然后在搜索下拉菜单中选择“所有{% data variables.product.prodname_dotcom %}”。 +- 要在特定存储库或组织中搜索,请导航到该存储库或组织页面,在页面顶部的搜索字段中输入要查找的内容,然后按 Enter。 {% note %} -**Notes:** +**注意:** {% ifversion fpt or ghes or ghec %} - {% data reusables.search.required_login %}{% endif %} -- {% data variables.product.prodname_pages %} sites are not searchable on {% data variables.product.product_name %}. However you can search the source content if it exists in the default branch of a repository, using code search. For more information, see "[Searching code](/search-github/searching-on-github/searching-code)." For more information about {% data variables.product.prodname_pages %}, see "[What is GitHub Pages?](/articles/what-is-github-pages/)" -- Currently our search doesn't support exact matching. -- Whenever you are searching in code files, only the first two results in each file will be returned. +- {% data variables.product.prodname_pages %} 网站在 {% data variables.product.product_name %} 上不可搜索。 但如果源代码内容存在于仓库的默认分支中,您可以使用代码搜索来搜索。 有关详细信息,请参阅“[搜索代码](/search-github/searching-on-github/searching-code)”。 有关 {% data variables.product.prodname_pages %} 的详细信息,请参阅“[什么是 GitHub 页面?](/articles/what-is-github-pages/)” +- 目前我们的搜索不支持精确匹配。 +- 每当您在代码文件中搜索时,将仅返回每个文件中的前两个结果。 {% endnote %} -After running a search on {% data variables.product.product_name %}, you can sort the results, or further refine them by clicking one of the languages in the sidebar. For more information, see "[Sorting search results](/search-github/getting-started-with-searching-on-github/sorting-search-results)." +在 {% data variables.product.product_name %} 上搜索后,您可以对结果排序,或者单击侧栏中的任一语言进一步改进搜索。 有关详细信息,请参阅“[对搜索结果进行排序](/search-github/getting-started-with-searching-on-github/sorting-search-results)”。 -{% data variables.product.product_name %} search uses an ElasticSearch cluster to index projects every time a change is pushed to {% data variables.product.product_name %}. Issues and pull requests are indexed when they are created or modified. +每次推送更改到 {% data variables.product.product_name %} 时,{% data variables.product.product_name %} 搜索都会使用 ElasticSearch 群集对项目编制索引。 议题和拉取请求在创建或修改时都会编制索引。 -## Types of searches on {% data variables.product.prodname_dotcom %} +## {% data variables.product.prodname_dotcom %} 上的搜索类型 -You can search for the following information across all repositories you can access on {% data variables.location.product_location %}. +可以在 {% data variables.location.product_location %} 上可以访问的所有存储库中搜索以下信息。 -- [Repositories](/search-github/searching-on-github/searching-for-repositories) -- [Topics](/search-github/searching-on-github/searching-topics) -- [Issues and pull requests](/search-github/searching-on-github/searching-issues-and-pull-requests){% ifversion fpt or ghec %} -- [Discussions](/search-github/searching-on-github/searching-discussions){% endif %} -- [Code](/search-github/searching-on-github/searching-code) -- [Commits](/search-github/searching-on-github/searching-commits) -- [Users](/search-github/searching-on-github/searching-users) -- [Packages](/search-github/searching-on-github/searching-for-packages) -- [Wikis](/search-github/searching-on-github/searching-wikis) +- [存储库](/search-github/searching-on-github/searching-for-repositories) +- [主题](/search-github/searching-on-github/searching-topics) +- [问题和拉取请求](/search-github/searching-on-github/searching-issues-and-pull-requests){% ifversion fpt or ghec %} +- [讨论](/search-github/searching-on-github/searching-discussions){% endif %} +- [代码](/search-github/searching-on-github/searching-code) +- [提交](/search-github/searching-on-github/searching-commits) +- [用户](/search-github/searching-on-github/searching-users) +- [包](/search-github/searching-on-github/searching-for-packages) +- [Wiki](/search-github/searching-on-github/searching-wikis) -## Searching using a visual interface +## 使用可视界面搜索 -You can search {% data variables.product.product_name %} using the {% data variables.search.search_page_url %} or {% data variables.search.advanced_url %}. {% ifversion command-palette %}Alternatively, you can use the interactive search in the {% data variables.product.prodname_command_palette %} to search your current location in the UI, a specific user, repository or organization, and globally across all of {% data variables.product.product_name %}, without leaving the keyboard. For more information, see "[{% data variables.product.prodname_command_palette %}](/get-started/using-github/github-command-palette)."{% endif %} +您可以使用 {% data variables.search.search_page_url %} 或 {% data variables.search.advanced_url %} 搜索 {% data variables.product.product_name %}。 {% ifversion command-palette %}或者,可使用 {% data variables.product.prodname_command_palette %} 中的交互式搜索在 UI、特定用户、存储库或组织中搜索当前位置,并在所有 {% data variables.product.product_name %} 中全局搜索,而无需离开键盘。 有关详细信息,请参阅“[{% data variables.product.prodname_command_palette %}](/get-started/using-github/github-command-palette)”。{% endif %} -The {% data variables.search.advanced_url %} provides a visual interface for constructing search queries. You can filter your searches by a variety of factors, such as the number of stars or number of forks a repository has. As you fill in the advanced search fields, your query will automatically be constructed in the top search bar. +{% data variables.search.advanced_url %} 提供用于构建搜索查询的可视界面。 您可以按各种因素过滤搜索,例如仓库具有的星标数或复刻数。 在填写高级搜索字段时,您的查询将在顶部搜索栏中自动构建。 -![Advanced Search](/assets/images/help/search/advanced_search_demo.gif) +![高级搜索](/assets/images/help/search/advanced_search_demo.gif) -## Searching repositories on {% data variables.product.prodname_dotcom_the_website %} from your private enterprise environment +## 从您的私有企业环境中搜索 {% data variables.product.prodname_dotcom_the_website %} 上的存储库 {% ifversion fpt or ghec %} -If you use both {% data variables.product.prodname_dotcom_the_website %} and {% data variables.product.prodname_ghe_server %} or {% data variables.product.prodname_ghe_managed %}, and an enterprise owner has enabled {% data variables.enterprise.prodname_unified_search %}, you can search across both environments at the same time from {% data variables.product.prodname_ghe_server %} or {% data variables.product.prodname_ghe_managed %}. For more information, see [the {% data variables.product.prodname_ghe_server %} documentation](/enterprise-server@latest/search-github/getting-started-with-searching-on-github/about-searching-on-github#searching-repositories-on-githubcom-from-your-private-enterprise-environment) or [the {% data variables.product.prodname_ghe_managed %} documentation](/github-ae@latest/search-github/getting-started-with-searching-on-github/about-searching-on-github#searching-repositories-on-githubcom-from-your-private-enterprise-environment). +如果你使用 {% data variables.product.prodname_dotcom_the_website %} 和 {% data variables.product.prodname_ghe_server %} 或 {% data variables.product.prodname_ghe_managed %},并且企业所有者已启用 {% data variables.enterprise.prodname_unified_search %},则可以从 {% data variables.product.prodname_ghe_server %} 或 {% data variables.product.prodname_ghe_managed %} 同时搜索这两个环境。 有关详细信息,请参阅 [{% data variables.product.prodname_ghe_server %} 文档](/enterprise-server@latest/search-github/getting-started-with-searching-on-github/about-searching-on-github#searching-repositories-on-githubcom-from-your-private-enterprise-environment)或 [{% data variables.product.prodname_ghe_managed %} 文档](/github-ae@latest/search-github/getting-started-with-searching-on-github/about-searching-on-github#searching-repositories-on-githubcom-from-your-private-enterprise-environment)。 {% else %} -If you use both {% data variables.product.prodname_dotcom_the_website %} and {% data variables.product.product_name %}, and an enterprise owner has enabled {% data variables.enterprise.prodname_unified_search %}, you can search across both environments at the same time from {% data variables.product.product_name %}. For more information about how enterprise owners can enable {% data variables.enterprise.prodname_unified_search %}, see "[Enabling {% data variables.enterprise.prodname_unified_search %} for your enterprise](/admin/configuration/configuring-github-connect/enabling-unified-search-for-your-enterprise)." +如果你使用 {% data variables.product.prodname_dotcom_the_website %} 和 {% data variables.product.product_name %},并且企业所有者已启用 {% data variables.enterprise.prodname_unified_search %},则可以同时从 {% data variables.product.product_name %} 搜索这两个环境。 若要详细了解企业所有者如何启用 {% data variables.enterprise.prodname_unified_search %},请参阅“[为企业启用 {% data variables.enterprise.prodname_unified_search %}](/admin/configuration/configuring-github-connect/enabling-unified-search-for-your-enterprise)”。 -Your enterprise owner on {% data variables.product.product_name %} can separately enable {% data variables.enterprise.prodname_unified_search %} for all public repositories on {% data variables.product.prodname_dotcom_the_website %} and for private repositories owned by the organization or enterprise on {% data variables.product.prodname_dotcom_the_website %} that is connected to {% data variables.product.product_name %} through {% data variables.product.prodname_github_connect %}. +{% data variables.product.product_name %} 上的企业所有者可以单独为 {% data variables.product.prodname_dotcom_the_website %} 上的所有公共存储库以及通过 {% data variables.product.prodname_github_connect %} 连接到 {% data variables.product.product_name %} 的 {% data variables.product.prodname_dotcom_the_website %} 上的组织或企业拥有的专用存储库启用 {% data variables.enterprise.prodname_unified_search %}。 -Before you can use {% data variables.enterprise.prodname_unified_search %} for private repositories, you must connect your personal accounts on {% data variables.product.prodname_dotcom_the_website %} and {% data variables.product.product_name %}. For more information, see "[Enabling {% data variables.product.prodname_dotcom_the_website %} repository search from your private enterprise environment](/search-github/getting-started-with-searching-on-github/enabling-githubcom-repository-search-from-your-private-enterprise-environment)." +在将 {% data variables.enterprise.prodname_unified_search %} 用于专用存储库之前,必须在 {% data variables.product.prodname_dotcom_the_website %} 和 {% data variables.product.product_name %} 上连接个人帐户。 有关详细信息,请参阅“[在专用企业环境中启用 {% data variables.product.prodname_dotcom_the_website %} 存储库搜索](/search-github/getting-started-with-searching-on-github/enabling-githubcom-repository-search-from-your-private-enterprise-environment)”。 -When you search from {% data variables.product.product_name %}, only private repositories that you have access to and that are owned by the connected organization or enterprise account will be included in search results. Neither you nor anyone else will be able to search private repositories owned by your personal account on {% data variables.product.prodname_dotcom_the_website %} from {% data variables.product.product_name %}. +从 {% data variables.product.product_name %} 进行搜索时,只有你有权访问且由已连接的组织或企业帐户拥有的专用存储库才会包含在搜索结果中。 你和其他人都无法从 {% data variables.product.product_name %} 搜索 {% data variables.product.prodname_dotcom_the_website %} 上的个人帐户拥有的专用存储库。 -To limit your search to one environment, you can use a filter option on the {% data variables.search.advanced_url %} or you can use the `environment:` search prefix. To only search for content on {% data variables.product.product_name %}, use the search syntax `environment:local`. To only search for content on {% data variables.product.prodname_dotcom_the_website %}, use `environment:github`. +若要将你的搜索限制到一个环境,可以使用 {% data variables.search.advanced_url %} 上的筛选器选项,或者使用 `environment:` 搜索前缀。 若要仅搜索 {% data variables.product.product_name %} 上的内容,请使用搜索语法 `environment:local`。 若要仅搜索 {% data variables.product.prodname_dotcom_the_website %} 上的内容,请使用 `environment:github`。 {% endif %} -## Further reading +## 延伸阅读 -- "[Understanding the search syntax](/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax)" -- "[Searching on GitHub](/articles/searching-on-github)" +- [了解搜索语法](/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax) +- [在 GitHub 上搜索](/articles/searching-on-github) diff --git a/translations/zh-CN/content/search-github/github-code-search/about-github-code-search.md b/translations/zh-CN/content/search-github/github-code-search/about-github-code-search.md new file mode 100644 index 0000000000..61db4dd33c --- /dev/null +++ b/translations/zh-CN/content/search-github/github-code-search/about-github-code-search.md @@ -0,0 +1,58 @@ +--- +title: 关于 GitHub 代码搜索(beta 版本) +intro: 可以使用新的代码搜索(beta 版本)在 GitHub 中搜索、导航和了解代码。 +allowTitleToDifferFromFilename: true +versions: + feature: github-code-search +topics: + - GitHub search +ms.openlocfilehash: 8bf3232e87de2fc773f69bf5047e75ab0e52c7e2 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159523' +--- +{% note %} + +注意:{% data reusables.search.code-search-code-view-beta-note %} + +{% data reusables.search.code-view-link %} + +{% endnote %} + +## 关于新的代码搜索(beta 版本) + +可使用新的代码搜索(beta 版本)快速搜索、导航和了解你的代码、团队的代码以及开放源代码社区的代码,这一切可通过 {% data variables.product.prodname_dotcom_the_website %} 实现。 此搜索引擎设计为可缩放、代码感知,并支持使用正则表达式、布尔运算、专用限定符和符号搜索在 GitHub 中搜索代码。 有关新的代码搜索(beta 版本)的语法的详细信息,请参阅“[了解 GitHub 代码搜索(beta 版本)语法](/search-github/github-code-search/understanding-github-code-search-syntax)”。 + +在新的代码搜索引擎的基础上,代码搜索(beta 版本)包括 {% data variables.product.prodname_dotcom_the_website %} 上的搜索界面中的新功能,例如建议、完成和保存搜索的功能。 借助新的搜索界面,可以更快、更轻松地找到要查找的内容。 有关详细信息,请参阅“[使用 GitHub 代码搜索(beta 版本)](/search-github/github-code-search/using-github-code-search)”。 + +{% data reusables.search.non-code-search-explanation %} + +新的代码搜索(beta 版本)与 {% data variables.product.prodname_dotcom_the_website %} 上重新设计的代码视图(beta 版本)紧密集成。 {% data reusables.search.code-view-link %} + +若要访问新的代码搜索(beta 版本)以及新的代码视图,可以注册[等待列表](https://github.com/features/code-search-code-view/signup)。 + +## 启用和禁用新的代码搜索和代码视图(beta 版本) + +{% data reusables.search.enabling-and-disabling-code-search-and-view-beta %} + +## 限制 + +我们已为新的代码搜索(beta 版本)编制了许多公共存储库索引,并将继续编制更多索引。 此外,Beta 版本 GitHub 用户的专用存储库已编制索引,可供已经可以访问 GitHub.com 上的专用存储库的 Beta 版本参与者搜索。 但是,目前可能不会为非常大的存储库编制索引,并且并非所有代码都已编制索引。 + +当前对编制索引的代码的限制是: + - 排除供应商和生成的代码(由 [Enry](https://github.com/go-enry/go-enry) 确定) + - 排除空文件和超过 350 KiB 的文件 + - 仅包含 UTF-8 编码文件 + - 可能不会为非常大的存储库编制索引 + +目前仅支持在存储库的默认分支上搜索代码。 + +使用新代码搜索(beta 版本)的任何搜索的结果限制为 100 个结果(10 页)。 代码搜索结果目前不支持排序。 此限制仅适用于使用新代码搜索(beta 版本)搜索代码,不适用于其他类型的搜索。 + +新的代码搜索(beta 版本)支持使用 `symbol:` 限定符在代码中搜索符号定义,例如函数或类定义。 但是,请注意 `symbol:` 限定符仅搜索定义而不搜索引用,并且尚未完全支持所有符号类型或语言。 有关受支持语言的列表,请参阅“[符号限定符](/search-github/github-code-search/understanding-github-code-search-syntax#symbol-qualifier)”。 + +## 反馈和支持 + +可以在[论坛](https://github.com/orgs/community/discussions/categories/code-search-and-navigation)中查看和分享有关新代码搜索(beta 版本)的反馈。 diff --git a/translations/zh-CN/content/search-github/github-code-search/index.md b/translations/zh-CN/content/search-github/github-code-search/index.md new file mode 100644 index 0000000000..b9912f3f32 --- /dev/null +++ b/translations/zh-CN/content/search-github/github-code-search/index.md @@ -0,0 +1,26 @@ +--- +title: GitHub 代码搜索(beta 版本) +intro: '您可以使用多种语法来搜索 {% data variables.product.product_name %}。 可以调整搜索范围、生成查询并对其进行故障排除,并使用限定符缩小搜索结果的范围。' +allowTitleToDifferFromFilename: true +versions: + feature: github-code-search +topics: + - GitHub search +children: + - /about-github-code-search + - /using-github-code-search + - /understanding-github-code-search-syntax +ms.openlocfilehash: a2420a27a7026b61dff0d05650d4b525f9d55adb +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159467' +--- +{% note %} + +注意:{% data reusables.search.code-search-code-view-beta-note %} + +{% data reusables.search.code-search-link %} {% data reusables.search.code-view-link %} + +{% endnote %} diff --git a/translations/zh-CN/content/search-github/github-code-search/understanding-github-code-search-syntax.md b/translations/zh-CN/content/search-github/github-code-search/understanding-github-code-search-syntax.md new file mode 100644 index 0000000000..c31d5bd36b --- /dev/null +++ b/translations/zh-CN/content/search-github/github-code-search/understanding-github-code-search-syntax.md @@ -0,0 +1,293 @@ +--- +title: 了解 GitHub 代码搜索 (beta) 语法 +intro: 可以使用专用代码限定符、正则表达式和布尔运算生成用于查询所需结果的搜索查询。 +allowTitleToDifferFromFilename: true +versions: + feature: github-code-search +topics: + - GitHub search +ms.openlocfilehash: 098da2b7fe8a8c5466805c583e6b029b5b9b58c1 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159476' +--- +{% note %} + +注意:{% data reusables.search.code-search-code-view-beta-note %} + +{% data reusables.search.code-search-link %} {% data reusables.search.code-view-link %} + +{% endnote %} + +## 关于新代码搜索 (beta) 查询结构 + +本文中的搜索语法仅适用于启用了新代码搜索 (beta) 的搜索代码。 {% data reusables.search.non-code-search-explanation %} + +搜索查询由搜索词(包括要搜索的文本)和限定符(可缩小搜索范围)组成。 + +一个没有限定符的裸词将与文件的内容或文件的路径匹配。 + +例如,以下查询: + +``` +http-push +``` + +上述查询与文件 `docs/http-push.txt` 匹配,即使该文件不包含术语 `http-push`。 该查询还与名为 `example.txt` 的文件匹配(如果文件包含术语 `http-push`)。 + +可以输入多个用空格分隔的术语,以搜索满足这两个字词的文档。 + +例如,以下查询: + +``` +sparse index +``` + +搜索结果将包括包含术语 `sparse` 和 `index` 的所有文档,并按任意顺序排列。 例如,它将匹配包含 `SparseIndexVector` 的文件、带有短语 `index for sparse trees` 的文件,甚至匹配名为 `index.txt` 且包含术语 `sparse` 的文件。 + +搜索多个用空格分隔的术语等效于搜索 `hello AND world`。 新的代码搜索 (beta) 也支持其他布尔运算,例如 `hello OR world`。 有关布尔运算的详细信息,请参阅“[使用布尔运算](#using-boolean-operations)”。 + +新的代码搜索 (beta) 还支持搜索确切的字符串,包括空格。 有关详细信息,请参阅“[查询完全匹配项](#query-for-an-exact-match)”。 + +可以使用专用限定符(如 `repo:`、`language:` 和 `path:`)缩小代码搜索范围。 有关可在新代码搜索 (beta) 中使用的限定符的详细信息,请参阅“[使用限定符](#using-qualifiers)”。 + +还可以通过用反斜杠将表达式括起来,在搜索中使用正则表达式。 有关使用正则表达式的详细信息,请参阅“[使用正则表达式](#using-regular-expressions)”。 + +## 查询完全匹配项 + +要搜索确切的字符串(包括空格),可以用引号将字符串括起来。 例如: + +``` +"sparse index" +``` + +若要搜索包含引号的短语,可以使用反斜杠对引号进行转义。 例如,若要查找确切的字符串 `name = "tensorflow"`,可以搜索: + +``` +"name = \"tensorflow\"" +``` + +还可以在限定符中使用带引号的字符串,例如: + +``` +path: git language: "protocol buffers" +``` + +## 使用布尔运算 + +新的代码搜索 (beta) 支持布尔表达式。 可以使用运算符 `AND`、`OR` 和 `NOT` 来组合搜索词。 + +默认情况下,用空格分隔的相邻术语等效于使用 `AND` 运算符。 例如,搜索查询 `sparse index` 与 `sparse AND index` 相同,这意味着搜索结果将包括包含术语 `sparse` 和 `index` 的所有文档,并按任意顺序排列。 + +若要搜索包含某个或其他术语的文档,可以使用 `OR` 运算符。 例如,以下查询将匹配包含 `sparse` 或 `index` 的文档: + +``` +sparse OR index +``` + +若要从搜索结果中排除文件,可以使用 `NOT` 运算符。 例如,若要排除 `__testing__` 目录中的文件,可以搜索: + +``` +"fatal error" NOT path:__testing__ +``` + +可以使用括号来表示更复杂的布尔表达式。 例如: + +``` +(language:ruby OR language:python) AND NOT path:"/tests/" +``` + +## 使用限定符 + +可以使用专用关键字来限定搜索。 +- [存储库限定符](#repository-qualifier) +- [组织和用户限定符](#organization-and-user-qualifiers) +- [语言限定符](#language-qualifier) +- [路径限定符](#path-qualifier) +- [符号限定符](#symbol-qualifier) +- [内容限定符](#content-qualifier) +- [Is 限定符](#is-qualifier) + +### 存储库限定符 + +若要在存储库中搜索,请使用 `repo:` 限定符。 必须提供完整的存储库名称,包括所有者。 例如: + +``` +repo:github/linguist +``` + +若要在一组存储库中搜索,可以将多个 `repo:` 限定符与布尔运算符 `OR` 组合在一起。 例如: + +``` +repo:github/linguist OR repo:tree-sitter/tree-sitter +``` + +{% note %} + +注意:新的代码搜索 beta 版目前不支持正则表达式或存储库名称的部分匹配,因此必须键入整个存储库名称(包括用户前缀)才能使用 `repo:` 限定符。 + +{% endnote %} + +### 组织和用户限定符 + +若要搜索组织内的文件,请使用 `org:` 限定符。 例如: + +``` +org:github +``` + +若要搜索个人帐户内的文件,请使用 `user:` 限定符。 例如: + +``` +user:octocat +``` + +{% note %} + +注意:新的代码搜索 beta 版当前不支持组织或用户名的正则表达式或部分匹配,因此必须键入整个组织或用户名才能使用限定符。 + +{% endnote %} + + +### 语言限定符 + +若要缩小到特定语言的范围,请使用 `language:` 限定符。 例如: + +``` +language: ruby OR language:cpp OR language:csharp +``` + +有关支持的语言名称的完整列表,请参阅 [github/linguist](https://github.com/github/linguist) 中的 [languages.yaml](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml)。 如果你的首选语言不在列表中,则可以打开拉取请求来添加它。 + +### 路径限定符 + +若要在文件路径中搜索,请使用 `path:` 限定符。 这将匹配包含文件路径中任意位置的术语的文件。 例如,若要查找路径中包含术语 `unit_tests` 的文件,请使用: + +``` +path:unit_tests +``` + 上面的查询将匹配 `src/unit_tests/my_test.py` 和 `src/docs/unit_tests.md`,因为它们都包含路径中某处的 `unit_test`。 + + 若要仅匹配特定文件名(而不是路径的一部分),可以使用正则表达式: + + ``` + path:/(^|\/)README\.md$/ + ``` +请注意,文件名中的 `.` 是转义的,因为 `.` 对正则表达式具有特殊含义。 有关使用正则表达式的详细信息,请参阅“[使用正则表达式](#using-regular-expressions)”。 + +
+ +还可以在 `path:` 限定符中使用一些有限的 glob 表达式。 + +例如,若要搜索扩展名为 `txt` 的文件,可以使用: + +``` +path:*.txt +``` +
+若要在 `src` 目录中搜索 JavaScript 文件,可以使用: + +``` +path:src/*.js +``` + +- 默认情况下,glob 表达式不会定位到路径的开头,因此上述表达式仍将与类似 `app/src/main.js` 的路径匹配。 但是,如果在表达式前面加上 `/`,它将定位到开头。 例如: + + ``` + path:/src/*.js + ``` +- 请注意,`*` 与 `/` 字符不匹配,因此对于上面的示例,所有结果都将是 `src` 目录的直接后代。 若要在子目录中匹配,以便结果包含深层嵌套文件(如 `/src/app/testing/utils/example.js`),可以使用 `**`。 例如: + + ``` + path:/src/**/*.js + ``` +
+ +可以使用 `?` 全局字符。 例如,若要匹配路径 `file.aac` 或 `file.abc`,可以使用: + +``` +path:*.a?c +``` +
+若要搜索包含特殊字符(如 `*` 或 `?`)的文件名,只需使用带引号的字符串: + +``` +path:"file?" +``` + +由于对带引号的字符串禁用 glob 表达式,因此上述查询将仅匹配包含文本字符串 `file?` 的路径。 + +### 符号限定符 + +可以使用 `symbol:` 限定符在代码中搜索符号定义(例如函数或类定义)。 符号搜索基于使用开源 [Tree-sitter](https://github.com/tree-sitter) 分析程序生态系统解析代码,因此不需要额外的设置或生成工具集成。 + +例如,若要搜索名为 `WithContext` 的符号: + +``` +language:go symbol:WithContext +``` + +在某些语言中,可以使用前缀(例如类名的前缀)搜索符号。 例如,对于结构 `Maint` 上的方法 `deleteRows`,可以在使用 Go 时搜索 `symbol:Maint.deleteRows`,或在 Rust 中搜索 `symbol:Maint::deleteRows`。 + +还可以将正则表达式与符号限定符一起使用。 例如,以下查询将查找人们在 Rust 中为 `String` 类型实现的转换: + +``` +language:rust symbol:/^String::to_.*/ +``` + +请注意,此限定符仅搜索定义而不搜索引用,并且尚未完全支持所有符号类型或语言。 以下语言支持符号提取。 + +- C# +- Python +- Go +- Java +- JavaScript +- TypeScript +- PHP +- 协议缓冲区 +- Ruby +- Rust + +我们正在努力添加对更多语言的支持。 如果想为这项工作做出贡献,可以在符号搜索基于的开源 [Tree-sitter](https://github.com/tree-sitter) 分析程序生态系统中添加对语言的支持。 + +### 内容限定符 + +默认情况下,裸词搜索路径和文件内容。 若要将搜索限制为严格匹配文件内容而不是文件路径,请使用 `content:` 限定符。 例如: + +``` +content:README.md +``` + +此查询仅匹配包含术语 `README.md` 的文件,而不匹配名为 `README.md` 的文件。 + +### Is 限定符 + +若要根据文档属性进行筛选,可以使用 `is:` 限定符。 目前,此限定符中唯一支持的值是 `archived`,这会将搜索限制为存档存储库。 例如: + +``` +path:/MIT.txt is:archived +``` + +请注意,可以使用 `is:` 运算符反转 `NOT` 限定符。 若要搜索未存档的存储库,可以搜索: + +``` +log4j NOT is:archived +``` + +## 使用正则表达式 + +新的代码搜索 (beta) 支持正则表达式来搜索代码中的模式。 通过用反斜杠将正则表达式括起来,可以在裸搜索词以及许多限定符中使用正则表达式。 + +例如,若要搜索正则表达式 `sparse.*index`,可以使用: + +``` +/sparse.*index/ +``` + +请注意,必须在正则表达式中转义任何正斜杠。 例如,若要搜索 `App/src` 目录中的文件,可以使用: + +``` +/^App\/src\// +``` diff --git a/translations/zh-CN/content/search-github/github-code-search/using-github-code-search.md b/translations/zh-CN/content/search-github/github-code-search/using-github-code-search.md new file mode 100644 index 0000000000..eb5658ceac --- /dev/null +++ b/translations/zh-CN/content/search-github/github-code-search/using-github-code-search.md @@ -0,0 +1,81 @@ +--- +title: 使用 GitHub 代码搜索(beta 版本) +intro: '你可以在升级后的搜索界面中使用建议、完成和保存的搜索,快速找到你在 {% data variables.product.prodname_dotcom_the_website %} 查找中的内容。' +allowTitleToDifferFromFilename: true +versions: + feature: github-code-search +topics: + - GitHub search +ms.openlocfilehash: 7578dd05f251b1df23fbd64c63d04e533f7fa9ef +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159517' +--- +{% note %} + +注意:{% data reusables.search.code-search-code-view-beta-note %} + +{% data reusables.search.code-search-link %} {% data reusables.search.code-view-link %} + +{% endnote %} + +## 关于使用新代码搜索(beta 版本) + +在获得新代码搜索 beta 版访问权限后,GitHub 将为你拥有的任何存储库以及所属组织中任何存储库编制索引,无论是公共、专用还是内部存储库。 这意味着,除了已编制索引的 {% data variables.product.prodname_dotcom_the_website %} 上的公共存储库外,可以在所有存储库中搜索。 只有有权查看 {% data variables.product.prodname_dotcom_the_website %} 上代码的用户才能查看搜索结果中的代码。 分支的编制索引和搜索方式与其他存储库相同。 + +并非所有代码都已编制索引,你目前只能搜索存储库的默认分支。 有关已知限制的详细信息,请参阅“[关于 GitHub 代码搜索(beta 版本)](/search-github/github-code-search/about-github-code-search#limitations)”。 + +新代码搜索 beta 版已集成到新的代码视图 beta 版中。 {% data reusables.search.code-view-link %} + +## 使用搜索栏 + +Beta 版基于新的代码搜索引擎,包括 {% data variables.product.prodname_dotcom_the_website %} 上升级的搜索界面。 使用建议、完成内容和保存的搜索,可以快速找到要查找的内容,通常无需完全键入查询或查看搜索结果页。 + +有关新代码搜索(beta 版本)的搜索语法的详细信息,请参阅“[了解 GitHub Code Search(beta 版本)语法](/search-github/github-code-search/understanding-github-code-search-syntax)”。 + +{% data reusables.search.non-code-search-explanation %} + +1. 在 {% data variables.product.prodname_dotcom_the_website %} 的顶部导航中,单击搜索栏。 +1. 在搜索栏下,你将看到按类别组织的建议列表,包括最近搜索以及你有权访问的建议存储库、团队和项目。 还可以查看已创建的保存的搜索的列表。 有关保存的搜索的详细信息,请参阅“[创建和管理保存的搜索](#creating-and-managing-saved-searches)”。 + + ![包含建议和保存的搜索的搜索栏](/assets/images/help/search/code-search-beta-search-bar.png) + + 如果单击任何特定建议,将直接转到该建议的页面(例如,存储库或项目页面)。 如果单击最近或保存的搜索,根据搜索的类型,搜索查询或显示在搜索栏中,或者将转到搜索词的搜索结果页。 + +1. 开始键入搜索查询后,将看到与查询匹配的完成内容和建议的列表。 可以单击建议跳转到特定位置。 键入更多限定符时,将看到更具体的建议,例如可以直接跳转到的代码文件。 + + ![包含查询和代码建议的搜索栏](/assets/images/help/search/code-search-beta-search-bar-code-suggestions.png) + +1. 键入查询后,还可以按 Enter 转到完整的搜索结果视图,可在其中查看每个匹配项和用于应用筛选器的可视化界面。 有关详细信息,请参阅“[使用搜索结果视图](#using-the-search-results-view)”。 + +## 创建和管理保存的搜索 + +1. 在 {% data variables.product.prodname_dotcom_the_website %} 的顶部导航中,单击搜索栏并开始键入搜索查询(或任何字母)。 +1. 在搜索栏下,现在应已显示“保存的搜索”部分。 单击 {% octicon "plus-circle" aria-label="The plus-circle icon" %}“创建保存的搜索”。 + + ![搜索栏中的“创建保存的搜索”按钮](/assets/images/help/search/code-search-beta-create-saved-search.png) + +1. 在弹出窗口中,为查询和要保存的查询填写所需的名称。 单击“创建保存的搜索” + + ![“创建保存的搜索”窗口](/assets/images/help/search/code-search-beta-create-saved-search-window.png) + +1. 如果再次单击搜索栏,现在可以在搜索栏下的“保存的搜索”部分看到保存的搜索。 单击保存的搜索项会将查询添加到搜索栏,并相应地筛选建议。 + + ![在搜索栏中使用保存的搜索](/assets/images/help/search/code-search-beta-saved-search-in-search-bar.png) + + - 若要编辑保存的搜索,请在“保存的搜索”部分中,单击保存的搜索右侧的 {% octicon "pencil" aria-label="The pencil icon" %}。 + - 若要删除保存的搜索,请单击保存的搜索右侧的 {% octicon "trash" aria-label="The trash icon" %}。 + + ![用于编辑或删除保存的搜索的按钮](/assets/images/help/search/code-search-beta-edit-or-delete-saved-search.png) + +## 使用搜索结果视图 + +GitHub 上的经典搜索已有搜索结果视图,且大多数搜索类型(代码除外)的功能相同。 启用新代码搜索 beta 版本后,搜索结果页具有重新设计的 UI,并包含新代码搜索引擎支持的筛选器,例如路径和符号筛选器。 + +若要使用可视界面构造搜索查询以及查看和筛选结果,可以使用 {% data variables.search.search_page_url %} 或 {% data variables.search.advanced_url %}。 如果在搜索栏中键入搜索查询后按 Enter,则还会转到搜索结果视图。 + +在搜索结果视图中,可以在不同类型的搜索结果之间导航,包括代码、问题、拉取请求、存储库等。 还可以查看和使用筛选器。 + +![搜索结果视图](/assets/images/help/search/code-search-beta-results-view.png) diff --git a/translations/zh-CN/content/search-github/searching-on-github/searching-code.md b/translations/zh-CN/content/search-github/searching-on-github/searching-code.md index 3ac136a456..844cb384c7 100644 --- a/translations/zh-CN/content/search-github/searching-on-github/searching-code.md +++ b/translations/zh-CN/content/search-github/searching-on-github/searching-code.md @@ -1,6 +1,6 @@ --- -title: Searching code -intro: 'You can search for code on {% data variables.product.product_name %} and narrow the results using these code search qualifiers in any combination.' +title: 搜索代码 +intro: '您可以在 {% data variables.product.product_name %} 上搜索代码,并使用这些代码搜索限定符的任意组合缩小结果范围。' redirect_from: - /articles/searching-code - /github/searching-for-information-on-github/searching-files-in-a-repository-for-exact-matches @@ -14,108 +14,111 @@ versions: ghec: '*' topics: - GitHub search +ms.openlocfilehash: 125c17f1050cdb6d1b1d5a3d58d3e513eddce40f +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: '148159522' --- +{% ifversion github-code-search %} {% note %} -{% ifversion github-code-search %} - {% note %} + 注意:{% data reusables.search.classic-search-code-search-note %} - **Note:** {% data reusables.search.classic-search-code-search-note %} + {% endnote %} {% endif %} - {% endnote %} -{% endif %} +{% data reusables.search.you-can-search-globally %} 有关详细信息,请参阅“[关于在 GitHub 上搜索](/search-github/getting-started-with-searching-on-github/about-searching-on-github)”。 -{% data reusables.search.you-can-search-globally %} For more information, see "[About searching on GitHub](/search-github/getting-started-with-searching-on-github/about-searching-on-github)." - -You can only search code using these code search qualifiers. Search qualifiers specifically for repositories, users, or commits, will not work when searching for code. +您只能使用这些代码搜索限定符搜索代码。 搜索代码时,专用于仓库、用户或提交的搜索限定符将不起作用。 {% data reusables.search.syntax_tips %} -## Considerations for code search +## 代码搜索的注意事项 -Due to the complexity of searching code, there are some restrictions on how searches are performed: +由于搜索代码的复杂性,执行搜索的方式有一些限制: {% ifversion fpt or ghes or ghec %} - {% data reusables.search.required_login %}{% endif %} -- Code in [forks](/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks) is only searchable if the fork has more stars than the parent repository. Forks with fewer stars than the parent repository are **not** indexed for code search. To include forks with more stars than their parent in the search results, you will need to add `fork:true` or `fork:only` to your query. For more information, see "[Searching in forks](/search-github/searching-on-github/searching-in-forks)." -- Only the _default branch_ is indexed for code search.{% ifversion fpt or ghec %} -- Only files smaller than 384 KB are searchable.{% else %}* Only files smaller than 5 MB are searchable. -- Only the first 500 KB of each file is searchable.{% endif %} -- Up to 4,000 private{% ifversion ghec or ghes or ghae %} and internal{% endif %} repositories are searchable. These 4,000 repositories will be the most recently updated of the first 10,000 private{% ifversion ghec or ghes or ghae %} and internal{% endif %} repositories that you have access to. -- Only repositories with fewer than 500,000 files are searchable.{% ifversion fpt or ghec %} -- Only repositories that have had activity or have been returned in search results in the last year are searchable.{% endif %} -- Except with [`filename`](#search-by-filename) searches, you must always include at least one search term when searching source code. For example, searching for [`language:javascript`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ajavascript&type=Code&ref=searchresults) is not valid, while [`amazing language:javascript`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ajavascript&type=Code&ref=searchresults) is. -- At most, search results can show two fragments from the same file, but there may be more results within the file. -- You can't use the following wildcard characters as part of your search query: . , : ; / \ ` ' " = * ! ? # $ & + ^ | ~ < > ( ) { } [ ] @. The search will simply ignore these symbols. +- [分叉](/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks)中的代码仅当分叉有多于父级存储库的星时可搜索。 如果分叉的星少于父级存储库,则分叉没有针对代码搜索编制索引。 若要在搜索结果中包含星数多于其父级的分叉,需要将 `fork:true` 或 `fork:only` 添加到查询中。 有关详细信息,请参阅“[在分支中搜索](/search-github/searching-on-github/searching-in-forks)”。 +- 仅默认分支针对代码搜索编制了索引。{% ifversion fpt or ghec %} +- 只有小于 384 KB 的文件可搜索。{% else %}* 只有小于 5 MB 的文件可搜索。 +- 只有每个文件的前 500 KB 可搜索。{% endif %} +- 可搜索多达 4000 个专用 {% ifversion ghec or ghes or ghae %} 和内部{% endif %} 存储库。 这 4000 个存储库将是你有权访问的前 10000 个专用{% ifversion ghec or ghes or ghae %} 和内部{% endif %} 存储库中最近更新的存储库。 +- 只有文件少于 500,000 个的存储库可搜索。{% ifversion fpt or ghec %} +- 只能搜索去年有活动或已在搜索结果中返回的仓库。{% endif %} +- 除 [`filename`](#search-by-filename) 搜索外,在搜索源代码时,必须始终至少包含一个搜索词。 例如,搜索 [`language:javascript`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ajavascript&type=Code&ref=searchresults) 是无效的,而搜索 [`amazing language:javascript`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ajavascript&type=Code&ref=searchresults) 是有效的。 +- 搜索结果最多可显示同一文件的两个分段,但文件内可能有更多结果。 +- 无法使用以下通配符作为搜索查询的一部分:. , : ; / \ ` ' " = * ! ? # $ & + ^ | ~ < > ( ) { } [ ] @。 搜索只会忽略这些符号。 -## Search by the file contents or file path +## 按文件内容或文件路径搜索 -With the `in` qualifier you can restrict your search to the contents of the source code file, the file path, or both. When you omit this qualifier, only the file contents are searched. +通过使用 `in` 限定符,可以将搜索限制为源代码文件的内容和/或文件路径。 如果省略此限定符,则只搜索文件内容。 -| Qualifier | Example +| 限定符 | 示例 | ------------- | ------------- -| `in:file` | [**octocat in:file**](https://github.com/search?q=octocat+in%3Afile&type=Code) matches code where "octocat" appears in the file contents. -| `in:path` | [**octocat in:path**](https://github.com/search?q=octocat+in%3Apath&type=Code) matches code where "octocat" appears in the file path. -| | [**octocat in:file,path**](https://github.com/search?q=octocat+in%3Afile%2Cpath&type=Code) matches code where "octocat" appears in the file contents or the file path. +| `in:file` | [**octocat in:file**](https://github.com/search?q=octocat+in%3Afile&type=Code) 匹配“octocat”在文件内容中出现的代码。 +| `in:path` | [**octocat in:path**](https://github.com/search?q=octocat+in%3Apath&type=Code) 匹配“octocat”在文件路径中出现的代码。 +| | [**octocat in:file,path**](https://github.com/search?q=octocat+in%3Afile%2Cpath&type=Code) 匹配“octocat”在文件内容或文件路径中出现的代码。 -## Search within a user's or organization's repositories +## 在用户或组织的仓库内搜索 -To search the code in all repositories owned by a certain user or organization, you can use the `user` or `org` qualifier. To search the code in a specific repository, you can use the `repo` qualifier. +若要在特定用户或组织拥有的所有存储库中搜索代码,可使用 `user` 或 `org` 限定符。 要在特定存储库中搜索代码,可使用 `repo` 限定符。 -| Qualifier | Example +| 限定符 | 示例 | ------------- | ------------- -| user:USERNAME | [**user:defunkt extension:rb**](https://github.com/search?q=user%3Agithub+extension%3Arb&type=Code) matches code from @defunkt that ends in .rb. -| org:ORGNAME |[**org:github extension:js**](https://github.com/search?utf8=%E2%9C%93&q=org%3Agithub+extension%3Ajs&type=Code) matches code from GitHub that ends in .js. -| repo:USERNAME/REPOSITORY | [**repo:mozilla/shumway extension:as**](https://github.com/search?q=repo%3Amozilla%2Fshumway+extension%3Aas&type=Code) matches code from @mozilla's shumway project that ends in .as. +| user:USERNAME | [**user:defunkt extension:rb**](https://github.com/search?q=user%3Agithub+extension%3Arb&type=Code) 匹配 @defunkt 中以 .rb 结尾的代码。 +| org:ORGNAME |[**org:github extension:js**](https://github.com/search?utf8=%E2%9C%93&q=org%3Agithub+extension%3Ajs&type=Code) 匹配 GitHub 中以 .js 结尾的代码。 +| repo:USERNAME/REPOSITORY | [**repo:mozilla/shumway extension:as**](https://github.com/search?q=repo%3Amozilla%2Fshumway+extension%3Aas&type=Code) 匹配 @mozilla 的 shumway 项目中以 .as 结尾的代码。 -## Search by file location +## 按文件位置搜索 -You can use the `path` qualifier to search for source code that appears at a specific location in a repository. Use `path:/` to search for files that are located at the root level of a repository. Or specify a directory name or the path to a directory to search for files that are located within that directory or any of its subdirectories. +可使用 `path` 限定符搜索存储库中特定位置显示的源代码。 使用 `path:/` 可搜索位于存储库根目录级别的文件。 或者,指定目录名称或目录路径以搜索位于该命令或其任何子目录中的文件。 -| Qualifier | Example +| 限定符 | 示例 | ------------- | ------------- -| path:/ | [**octocat filename:readme path:/**](https://github.com/search?utf8=%E2%9C%93&q=octocat+filename%3Areadme+path%3A%2F&type=Code) matches _readme_ files with the word "octocat" that are located at the root level of a repository. -| path:DIRECTORY | [**form path:cgi-bin language:perl**](https://github.com/search?q=form+path%3Acgi-bin+language%3Aperl&type=Code) matches Perl files with the word "form" in the cgi-bin directory, or in any of its subdirectories. -| path:PATH/TO/DIRECTORY | [**`console path:app/public language:javascript`**](https://github.com/search?q=console+path%3A%22app%2Fpublic%22+language%3Ajavascript&type=Code) matches JavaScript files with the word "console" in the app/public directory, or in any of its subdirectories (even if they reside in app/public/js/form-validators). +| path:/ | [**octocat filename:readme path:/**](https://github.com/search?utf8=%E2%9C%93&q=octocat+filename%3Areadme+path%3A%2F&type=Code) 匹配位于存储库的根级别的包含“octocat”一词的自述文件。 +| path:DIRECTORY | [**form path:cgi-bin language:perl**](https://github.com/search?q=form+path%3Acgi-bin+language%3Aperl&type=Code) 匹配 cgi-bin 目录或其任何子目录中包含“form”一词的 Perl 文件。 +| path:PATH/TO/DIRECTORY | [ **`console path:app/public language:javascript`**](https://github.com/search?q=console+path%3A%22app%2Fpublic%22+language%3Ajavascript&type=Code) 匹配 app/public 目录或其任何子目录(即使它们位于 app/public/js/form-validators)中的具有“console”一词的 JavaScript 文件。 -## Search by language +## 按语言搜索 -You can search for code based on what language it's written in. The `language` qualifier can be the language name or alias. For a full list of supported languages with their names and aliases, see the [github/linguist repository](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml). +您可以基于所编写的语言搜索代码。 `language` 限定符可以是语言名称或别名。 有关支持的语言及其名称和别名的完整列表,请参阅 [github/linguist 存储库](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml)。 -| Qualifier | Example +| 限定符 | 示例 | ------------- | ------------- -| language:LANGUAGE | [**element language:xml size:100**](https://github.com/search?q=element+language%3Axml+size%3A100&type=Code) matches code with the word "element" that's marked as being XML and has exactly 100 bytes. -| | [**display language:scss**](https://github.com/search?q=display+language%3Ascss&type=Code) matches code with the word "display," that's marked as being SCSS. -| | [**org:mozilla language:markdown**](https://github.com/search?utf8=%E2%9C%93&q=org%3Amozilla+language%3Amarkdown&type=Code) matches code from all @mozilla's repositories that's marked as Markdown. +| language:LANGUAGE | [**element language:xml size:100**](https://github.com/search?q=element+language%3Axml+size%3A100&type=Code) 匹配标记为 XML 且刚好有 100 个字节的包含“element”一词的代码。 +| | [**display language:scss**](https://github.com/search?q=display+language%3Ascss&type=Code) 匹配标记为 SCSS 的具有单词“display”的代码。 +| | [**org:mozilla language:markdown**](https://github.com/search?utf8=%E2%9C%93&q=org%3Amozilla+language%3Amarkdown&type=Code) 匹配标记为 Markdown 的来自所有 @mozilla 存储库的代码。 -## Search by file size +## 按文件大小搜索 -You can use the `size` qualifier to search for source code based on the size of the file where the code exists. The `size` qualifier uses [greater than, less than, and range qualifiers](/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax) to filter results based on the byte size of the file in which the code is found. +可以使用 `size` 限定符基于代码所在文件的大小搜索源代码。 `size` 限定符使用[大于、小于和范围限定符](/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax)根据找到代码的文件的字节大小筛选结果。 -| Qualifier | Example +| 限定符 | 示例 | ------------- | ------------- -| size:n | [**function size:>10000 language:python**](https://github.com/search?q=function+size%3A%3E10000+language%3Apython&type=Code) matches code with the word "function," written in Python, in files that are larger than 10 KB. +| size:n | [**function size:>10000 language:python**](https://github.com/search?q=function+size%3A%3E10000+language%3Apython&type=Code) 匹配采用 Python 编写的位于大于 10 KB 的文件中的包含“function”一词的代码。 -## Search by filename +## 按文件名搜索 -The `filename` qualifier matches code files with a certain filename. You can also find a file in a repository using the file finder. For more information, see "[Finding files on GitHub](/search-github/searching-on-github/finding-files-on-github)." +`filename` 限定符匹配具有特定文件名的代码文件。 您还可以使用文件查找器在仓库中查找文件。 有关详细信息,请参阅“[在 GitHub 上查找文件](/search-github/searching-on-github/finding-files-on-github)”。 -| Qualifier | Example +| 限定符 | 示例 | ------------- | ------------- -| filename:FILENAME | [**filename:linguist**](https://github.com/search?utf8=%E2%9C%93&q=filename%3Alinguist&type=Code) matches files named "linguist." -| | [**filename:.vimrc commands**](https://github.com/search?q=filename%3A.vimrc+commands&type=Code) matches *.vimrc* files with the word "commands." -| | [**filename:test_helper path:test language:ruby**](https://github.com/search?q=minitest+filename%3Atest_helper+path%3Atest+language%3Aruby&type=Code) matches Ruby files named *test_helper* within the *test* directory. +| filename:FILENAME | [**filename:linguist**](https://github.com/search?utf8=%E2%9C%93&q=filename%3Alinguist&type=Code) 匹配名为“linguist”的文件。 +| | [**filename:.vimrc commands**](https://github.com/search?q=filename%3A.vimrc+commands&type=Code) 匹配具有“commands”一词的 .vimrc 文件。 +| | [**filename:test_helper path:test language:ruby**](https://github.com/search?q=minitest+filename%3Atest_helper+path%3Atest+language%3Aruby&type=Code) 匹配 test 目录中名为 test_helper 的 Ruby 文件 。 -## Search by file extension +## 按文件扩展名搜索 -The `extension` qualifier matches code files with a certain file extension. +`extension` 限定符匹配具有特定文件扩展名的代码文件。 -| Qualifier | Example +| 限定符 | 示例 | ------------- | ------------- -| extension:EXTENSION | [**form path:cgi-bin extension:pm**](https://github.com/search?q=form+path%3Acgi-bin+extension%3Apm&type=Code) matches code with the word "form," under cgi-bin, with the .pm file extension. -| | [**icon size:>200000 extension:css**](https://github.com/search?utf8=%E2%9C%93&q=icon+size%3A%3E200000+extension%3Acss&type=Code) matches files larger than 200 KB that end in .css and have the word "icon." +| extension:EXTENSION | [**form path:cgi-bin extension:pm**](https://github.com/search?q=form+path%3Acgi-bin+extension%3Apm&type=Code) 匹配 cgi-bin 下具有 .pm 文件扩展名的包含“form”一词的代码 +| | [**icon size:>200000 extension:css**](https://github.com/search?utf8=%E2%9C%93&q=icon+size%3A%3E200000+extension%3Acss&type=Code) 匹配大于 200 KB 的以 .css 结尾的包含“icon”一词的文件。 -## Further reading +## 延伸阅读 -- "[Sorting search results](/search-github/getting-started-with-searching-on-github/sorting-search-results/)" -- "[Searching in forks](/search-github/searching-on-github/searching-in-forks)"{% ifversion fpt or ghec %} -- "[Navigating code on {% data variables.product.prodname_dotcom %}](/github/managing-files-in-a-repository/navigating-code-on-github)"{% endif %} +- “[对搜索结果进行排序](/search-github/getting-started-with-searching-on-github/sorting-search-results/)” +- “[在分叉中搜索](/search-github/searching-on-github/searching-in-forks)”{% ifversion fpt or ghec %} +- “[在 {% data variables.product.prodname_dotcom %} 上导航代码](/github/managing-files-in-a-repository/navigating-code-on-github)”{% endif %} diff --git a/translations/zh-CN/data/features/ip-allow-list-address-check.yml b/translations/zh-CN/data/features/ip-allow-list-address-check.yml deleted file mode 100644 index 8e472cd129..0000000000 --- a/translations/zh-CN/data/features/ip-allow-list-address-check.yml +++ /dev/null @@ -1,3 +0,0 @@ -versions: - ghec: '*' - ghae: '问题-7818' diff --git a/translations/zh-CN/data/learning-tracks/admin.yml b/translations/zh-CN/data/learning-tracks/admin.yml index 6c84460f88..9f45bbaca7 100644 --- a/translations/zh-CN/data/learning-tracks/admin.yml +++ b/translations/zh-CN/data/learning-tracks/admin.yml @@ -9,7 +9,7 @@ get_started_with_github_ae: - /admin/overview/about-data-residency - /admin/configuration/configuring-your-enterprise/deploying-github-ae - /admin/configuration/initializing-github-ae - - /admin/configuration/restricting-network-traffic-to-your-enterprise + - /admin/configuration/configuring-your-enterprise/restricting-network-traffic-to-your-enterprise-with-an-ip-allow-list - /admin/github-actions/getting-started-with-github-actions-for-github-ae deploy_an_instance: diff --git a/translations/zh-CN/data/reusables/actions/ip-allow-list-self-hosted-runners.md b/translations/zh-CN/data/reusables/actions/ip-allow-list-self-hosted-runners.md index 4cb42a307d..8bc127db04 100644 --- a/translations/zh-CN/data/reusables/actions/ip-allow-list-self-hosted-runners.md +++ b/translations/zh-CN/data/reusables/actions/ip-allow-list-self-hosted-runners.md @@ -7,5 +7,5 @@ To allow your self-hosted runners to communicate with {% data variables.product. {% endwarning %} -To allow your self-hosted {% ifversion actions-hosted-runners %}or larger hosted{% endif %} runners to communicate with {% data variables.product.prodname_dotcom %}, add the IP address or IP address range of your runners to the IP allow list. For more information, see "[Adding an allowed IP address](#adding-an-allowed-ip-address)." +To allow your self-hosted {% ifversion actions-hosted-runners %}or larger hosted{% endif %} runners to communicate with {% data variables.product.prodname_dotcom %}, add the IP address or IP address range of your runners to the IP allow list that you have configured for your enterprise. {% endif %} diff --git a/translations/zh-CN/data/reusables/actions/ref_protected-description.md b/translations/zh-CN/data/reusables/actions/ref_protected-description.md index d639c4ffa7..efc7f65a11 100644 --- a/translations/zh-CN/data/reusables/actions/ref_protected-description.md +++ b/translations/zh-CN/data/reusables/actions/ref_protected-description.md @@ -1,9 +1,9 @@ --- -ms.openlocfilehash: e3a5d34c1e7fa7964296417f959e02f7d25322d1 -ms.sourcegitcommit: 47bd0e48c7dba1dde49baff60bc1eddc91ab10c5 +ms.openlocfilehash: aa83ecff715eed06bc0b455344b227e8676ee4e3 +ms.sourcegitcommit: 99eb4456062aea31ca381977396417cf92e5798d ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/05/2022 -ms.locfileid: "145065902" +ms.lasthandoff: 11/21/2022 +ms.locfileid: "148179577" --- -如果为触发工作流运行的 ref 配置分支保护,则为 `true`。 +如果为触发工作流运行的 ref 配置分支保护,则为 `true`。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/actions/ref_type-description.md b/translations/zh-CN/data/reusables/actions/ref_type-description.md index 27d59dcdcb..6ee94cb079 100644 --- a/translations/zh-CN/data/reusables/actions/ref_type-description.md +++ b/translations/zh-CN/data/reusables/actions/ref_type-description.md @@ -1,9 +1,9 @@ --- -ms.openlocfilehash: eb37287768f8539b10e549b5407c9aeb1170d1eb -ms.sourcegitcommit: 47bd0e48c7dba1dde49baff60bc1eddc91ab10c5 +ms.openlocfilehash: efa01b1ee2415e7b0aa1cc919fec24801839d2db +ms.sourcegitcommit: 99eb4456062aea31ca381977396417cf92e5798d ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/05/2022 -ms.locfileid: "145084875" +ms.lasthandoff: 11/21/2022 +ms.locfileid: "148179574" --- -触发工作流运行的 ref 类型。 有效值为 `branch` or `tag`进行求值的基于 SQL 语言的筛选器表达式。 +触发工作流运行的 ref 类型。 有效值为 `branch` or `tag`进行求值的基于 SQL 语言的筛选器表达式。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/actions/run_id_description.md b/translations/zh-CN/data/reusables/actions/run_id_description.md index b7fac33dab..990501ef12 100644 --- a/translations/zh-CN/data/reusables/actions/run_id_description.md +++ b/translations/zh-CN/data/reusables/actions/run_id_description.md @@ -1,9 +1,9 @@ --- -ms.openlocfilehash: d2eb1d49e6bb3057ce347b8bdd37f7f1a66014fa -ms.sourcegitcommit: fb047f9450b41b24afc43d9512a5db2a2b750a2a +ms.openlocfilehash: 3ceb785289a3b263eebda76d766bab52d6cec3c3 +ms.sourcegitcommit: 99eb4456062aea31ca381977396417cf92e5798d ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/11/2022 -ms.locfileid: "145065892" +ms.lasthandoff: 11/21/2022 +ms.locfileid: "148179570" --- -存储库中每个工作流运行的唯一编号。 如果您重新执行工作流程运行,此编号不变。 +存储库中每个工作流运行的唯一编号。 如果您重新执行工作流程运行,此编号不变。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/actions/run_number_description.md b/translations/zh-CN/data/reusables/actions/run_number_description.md index bf3c7287ec..7ab418a608 100644 --- a/translations/zh-CN/data/reusables/actions/run_number_description.md +++ b/translations/zh-CN/data/reusables/actions/run_number_description.md @@ -1,9 +1,9 @@ --- -ms.openlocfilehash: 4e92d27887f94b524e0e5d9c2d007b29e2dbb28b -ms.sourcegitcommit: 5b1461b419dbef60ae9dbdf8e905a4df30fc91b7 +ms.openlocfilehash: d3a31b63ff15fefd904ffeb91bb195e24cbafe19 +ms.sourcegitcommit: 99eb4456062aea31ca381977396417cf92e5798d ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/10/2022 -ms.locfileid: "147876089" +ms.lasthandoff: 11/21/2022 +ms.locfileid: "148179580" --- -仓库中特定工作流程每个运行的唯一编号。 工作流首次运行时,此编号从 1 开始,并随着每次新的运行而递增。 如果您重新执行工作流程运行,此编号不变。 +仓库中特定工作流程每个运行的唯一编号。 工作流首次运行时,此编号从 1 开始,并随着每次新的运行而递增。 如果您重新执行工作流程运行,此编号不变。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/actions/runner-arch-description.md b/translations/zh-CN/data/reusables/actions/runner-arch-description.md index 5c538640b7..afe80a7ddb 100644 --- a/translations/zh-CN/data/reusables/actions/runner-arch-description.md +++ b/translations/zh-CN/data/reusables/actions/runner-arch-description.md @@ -1,9 +1,9 @@ --- -ms.openlocfilehash: af8eda15fb2efa1997bec460be9f8d9549171c71 -ms.sourcegitcommit: fb047f9450b41b24afc43d9512a5db2a2b750a2a +ms.openlocfilehash: 217ff84c9edd02f476d3f25f01d384f46ab05e0c +ms.sourcegitcommit: 99eb4456062aea31ca381977396417cf92e5798d ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/11/2022 -ms.locfileid: "145084860" +ms.lasthandoff: 11/21/2022 +ms.locfileid: "148179579" --- -执行作业的运行器的体系结构。 可能的值为 `X86`、`X64`、`ARM` 或 `ARM64`。 +执行作业的运行器的体系结构。 可能的值为 `X86`、`X64`、`ARM` 或 `ARM64`。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/actions/runner-debug-description.md b/translations/zh-CN/data/reusables/actions/runner-debug-description.md index dfa3655b74..a51e6bfb37 100644 --- a/translations/zh-CN/data/reusables/actions/runner-debug-description.md +++ b/translations/zh-CN/data/reusables/actions/runner-debug-description.md @@ -1,9 +1,9 @@ --- -ms.openlocfilehash: e97366a49253e628513ace9247bb7f4c9301aa80 -ms.sourcegitcommit: 478f2931167988096ae6478a257f492ecaa11794 +ms.openlocfilehash: 1b97b54e74b57343a5bc824c86e2849f99c5f6a8 +ms.sourcegitcommit: 99eb4456062aea31ca381977396417cf92e5798d ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/09/2022 -ms.locfileid: "147614524" +ms.lasthandoff: 11/21/2022 +ms.locfileid: "148179582" --- -仅当启用[调试日志记录](/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging)并且始终具有值 `1` 时,才会进行此设置。 它可以用作指示器,以便在自己的作业步骤中启用更多调试或详细日志记录。 +仅当启用[调试日志记录](/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging)并且始终具有值 `1` 时,才会进行此设置。 它可以用作指示器,以便在自己的作业步骤中启用更多调试或详细日志记录。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/actions/runner-name-description.md b/translations/zh-CN/data/reusables/actions/runner-name-description.md index 71bab91722..e96ec504a4 100644 --- a/translations/zh-CN/data/reusables/actions/runner-name-description.md +++ b/translations/zh-CN/data/reusables/actions/runner-name-description.md @@ -1,9 +1,9 @@ --- -ms.openlocfilehash: 92f9c6962ced87f0075e67d91920b4262d376bbe -ms.sourcegitcommit: 5b1461b419dbef60ae9dbdf8e905a4df30fc91b7 +ms.openlocfilehash: 99093fe4bc8da22d7507cd16ffdbf5c3756ae83f +ms.sourcegitcommit: 99eb4456062aea31ca381977396417cf92e5798d ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/10/2022 -ms.locfileid: "147876094" +ms.lasthandoff: 11/21/2022 +ms.locfileid: "148179578" --- -执行作业的运行器的名称。 +执行作业的运行器的名称。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/actions/runner-os-description.md b/translations/zh-CN/data/reusables/actions/runner-os-description.md index b702cd6c0f..dcf4c2924a 100644 --- a/translations/zh-CN/data/reusables/actions/runner-os-description.md +++ b/translations/zh-CN/data/reusables/actions/runner-os-description.md @@ -1,9 +1,9 @@ --- -ms.openlocfilehash: 4bf3f1a9bd94d5faf665ceab4c30925162bf2977 -ms.sourcegitcommit: fb047f9450b41b24afc43d9512a5db2a2b750a2a +ms.openlocfilehash: 78f1e2366d4ae9645f335439efa2bb040194bea9 +ms.sourcegitcommit: 99eb4456062aea31ca381977396417cf92e5798d ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/11/2022 -ms.locfileid: "145084857" +ms.lasthandoff: 11/21/2022 +ms.locfileid: "148179569" --- -执行作业的运行器的操作系统。 可能的值为 `Linux`、`Windows` 或 `macOS`。 +执行作业的运行器的操作系统。 可能的值为 `Linux`、`Windows` 或 `macOS`。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/actions/runner-temp-directory-description.md b/translations/zh-CN/data/reusables/actions/runner-temp-directory-description.md index 2d9abc8cc0..5315c730d1 100644 --- a/translations/zh-CN/data/reusables/actions/runner-temp-directory-description.md +++ b/translations/zh-CN/data/reusables/actions/runner-temp-directory-description.md @@ -1,9 +1,9 @@ --- -ms.openlocfilehash: 2e1561ff6bfee56d135e4897fbc6d42e252a7809 -ms.sourcegitcommit: fb047f9450b41b24afc43d9512a5db2a2b750a2a +ms.openlocfilehash: b29e97e5613dbe28ac0769e4f814027d581a93a2 +ms.sourcegitcommit: 99eb4456062aea31ca381977396417cf92e5798d ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/11/2022 -ms.locfileid: "145065883" +ms.lasthandoff: 11/21/2022 +ms.locfileid: "148179576" --- -运行器临时目录的路径。 此目录在每个作业的开始和结束时都是空的。 注意,如果运行者的用户帐户没有权限删除这些文件,则不会被删除。 +运行器临时目录的路径。 此目录在每个作业的开始和结束时都是空的。 注意,如果运行者的用户帐户没有权限删除这些文件,则不会被删除。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/actions/runner-tool-cache-description.md b/translations/zh-CN/data/reusables/actions/runner-tool-cache-description.md index 8b010d1847..d9da722441 100644 --- a/translations/zh-CN/data/reusables/actions/runner-tool-cache-description.md +++ b/translations/zh-CN/data/reusables/actions/runner-tool-cache-description.md @@ -1,9 +1,9 @@ --- -ms.openlocfilehash: 6945058380431dbf753ad8dd9ce03c032193a46a -ms.sourcegitcommit: fb047f9450b41b24afc43d9512a5db2a2b750a2a +ms.openlocfilehash: b0adac22b7786fb4e5b712d86b4a0379611ab2ec +ms.sourcegitcommit: 99eb4456062aea31ca381977396417cf92e5798d ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/10/2022 -ms.locfileid: "145084856" +ms.lasthandoff: 11/21/2022 +ms.locfileid: "148179559" --- -包含 {% data variables.product.prodname_dotcom %} 托管运行器预安装工具的目录路径。 有关详细信息,请参阅“[有关 {% data variables.product.prodname_dotcom %} 托管的运行器](/actions/reference/specifications-for-github-hosted-runners/#supported-software)”。 +包含 {% data variables.product.prodname_dotcom %} 托管运行器预安装工具的目录路径。 有关详细信息,请参阅“[有关 {% data variables.product.prodname_dotcom %} 托管的运行器](/actions/reference/specifications-for-github-hosted-runners/#supported-software)”。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/actions/supported-github-runners.md b/translations/zh-CN/data/reusables/actions/supported-github-runners.md index e23f6b14c0..2599a33141 100644 --- a/translations/zh-CN/data/reusables/actions/supported-github-runners.md +++ b/translations/zh-CN/data/reusables/actions/supported-github-runners.md @@ -1,17 +1,9 @@ ---- -ms.openlocfilehash: c30f6000486156f1995f0f05ff27fc173b893de5 -ms.sourcegitcommit: 47bd0e48c7dba1dde49baff60bc1eddc91ab10c5 -ms.translationtype: HT -ms.contentlocale: zh-CN -ms.lasthandoff: 09/05/2022 -ms.locfileid: "147529270" ---- - - - + + + @@ -20,10 +12,10 @@ ms.locfileid: "147529270" Windows Server 2022 @@ -51,18 +43,21 @@ Ubuntu 22.04 Ubuntu 20.04 + @@ -78,21 +73,21 @@ macOS Monterey 12 macOS Big Sur 11 @@ -100,12 +95,12 @@ macOS Catalina 10.15 [已弃用] {% note %} -注意:`-latest` 运行器映像是 {% data variables.product.prodname_dotcom %} 提供的最新稳定映像,但可能不是操作系统供应商提供的最新版本的操作系统。 +**Note:** The `-latest` runner images are the latest stable images that {% data variables.product.prodname_dotcom %} provides, and might not be the most recent version of the operating system available from the operating system vendor. {% endnote %} {% warning %} -注意:Beta 版映像和已弃用的映像“按原样提供”、“包含全部错误”且“视可用性情况”提供,不包含在服务级别协议和保证之内。 客户支持可能不会涵盖 Beta 版映像。 +**Warning:** Beta and Deprecated Images are provided "as-is", "with all faults" and "as available" and are excluded from the service level agreement and warranty. Beta Images may not be covered by customer support. {% endwarning %} diff --git a/translations/zh-CN/data/reusables/advanced-security/more-information-about-enforcement-policy.md b/translations/zh-CN/data/reusables/advanced-security/more-information-about-enforcement-policy.md index 4aecddee6c..b4cd07ae27 100644 --- a/translations/zh-CN/data/reusables/advanced-security/more-information-about-enforcement-policy.md +++ b/translations/zh-CN/data/reusables/advanced-security/more-information-about-enforcement-policy.md @@ -1,9 +1,9 @@ --- -ms.openlocfilehash: 1b37f350d1a16509df7b661fcde678b6599b3f09 -ms.sourcegitcommit: fcf3546b7cc208155fb8acdf68b81be28afc3d2d +ms.openlocfilehash: 1da05f80c01813e53ccdb66c877587e3b2268d34 +ms.sourcegitcommit: 8d9e10685cfb2556fba0ce07484a3b9579808703 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/10/2022 -ms.locfileid: "147877238" +ms.lasthandoff: 11/18/2022 +ms.locfileid: "148172152" --- -有关详细信息,请参阅“[在企业中强制实施 {% data variables.product.prodname_advanced_security %} 策略]({% ifversion fpt %}/enterprise-cloud@latest{% endif %}/admin/policies/enforcing-policies-for-advanced-security-in-your-enterprise)”。 +有关详细信息,请参阅“[在企业中强制实施 {% data variables.product.prodname_advanced_security %} 策略]({% ifversion fpt %}/enterprise-cloud@latest{% endif %}/admin/policies/enforcing-policies-for-advanced-security-in-your-enterprise)”。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/classroom/assignments-guide-choose-visibility.md b/translations/zh-CN/data/reusables/classroom/assignments-guide-choose-visibility.md index 1404d5b61d..bc72a6d259 100644 --- a/translations/zh-CN/data/reusables/classroom/assignments-guide-choose-visibility.md +++ b/translations/zh-CN/data/reusables/classroom/assignments-guide-choose-visibility.md @@ -1,15 +1,11 @@ --- -ms.openlocfilehash: 66fdbca75762848fce18a18321fd082a844cfa3f -ms.sourcegitcommit: fcf3546b7cc208155fb8acdf68b81be28afc3d2d +ms.openlocfilehash: ec67345b92fb3aba571c6932ccc3b67d77473726 +ms.sourcegitcommit: 82b1242de02ecc4bdec02a5b6d11568fb2deb1aa ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/10/2022 -ms.locfileid: "145098844" +ms.lasthandoff: 11/21/2022 +ms.locfileid: "148179726" --- -作业的仓库可以是公开或私有的。 如果您使用私有仓库,只有学生或团队可以查看您提供的反馈。 - -您也可以决定是否授予学生对作业仓库的管理员权限。 如果学生应该能够执行作业仓库的管理任务,则授予管理员权限。 有关详细信息,请参阅“[关于存储库](/repositories/creating-and-managing-repositories/about-repositories#about-repository-visibility)”和“[组织的存储库角色](/organizations/managing-access-to-your-organizations-repositories/repository-roles-for-an-organization)”。 - 在“Repository visibility(仓库可见性)”下,选择可见性。 (可选)选择“授予学生对其存储库的管理员权限”。
diff --git a/translations/zh-CN/data/reusables/classroom/assignments-repository-visibility-and-permissions.md b/translations/zh-CN/data/reusables/classroom/assignments-repository-visibility-and-permissions.md new file mode 100644 index 0000000000..1d96aeae83 --- /dev/null +++ b/translations/zh-CN/data/reusables/classroom/assignments-repository-visibility-and-permissions.md @@ -0,0 +1,11 @@ +--- +ms.openlocfilehash: f5dc693751e91ffe9b472a5c99c1f359902873a0 +ms.sourcegitcommit: 82b1242de02ecc4bdec02a5b6d11568fb2deb1aa +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/21/2022 +ms.locfileid: "148179838" +--- +作业的仓库可以是公开或私有的。 如果您使用私有仓库,只有学生或团队可以查看您提供的反馈。 + +您也可以决定是否授予学生对作业仓库的管理员权限。 如果学生应该能够执行作业仓库的管理任务,则授予管理员权限。 有关详细信息,请参阅“[关于存储库](/repositories/creating-and-managing-repositories/about-repositories#about-repository-visibility)”和“[组织的存储库角色](/organizations/managing-access-to-your-organizations-repositories/repository-roles-for-an-organization)”。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/about-features.md b/translations/zh-CN/data/reusables/codespaces/about-features.md new file mode 100644 index 0000000000..35dcec0828 --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/about-features.md @@ -0,0 +1,11 @@ +--- +ms.openlocfilehash: 55348a01f34b4eb85873a075b637bdff802fcef3 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159456" +--- +功能是指安装代码和开发容器配置的独立单元,其设计目的是跨各种基本容器映像工作。 可以使用功能将工具、运行时或库快速添加到 codespace 映像。 有关详细信息,请参阅 containers.dev 上的[可用功能](https://containers.dev/features)和[功能规范](https://containers.dev/implementors/features/)。 + +可以从 {% data variables.product.prodname_vscode_shortname %} 或 {% data variables.product.prodname_dotcom_the_website %} 上的存储库向 `devcontainer.json` 文件添加功能。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/about-publishing-templates.md b/translations/zh-CN/data/reusables/codespaces/about-publishing-templates.md new file mode 100644 index 0000000000..8c689faabf --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/about-publishing-templates.md @@ -0,0 +1,13 @@ +--- +ms.openlocfilehash: 88adaa8f671dd9eb805301c3e659bcdba76f24cc +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159515" +--- +在从模板创建的 codespace 中工作时,你的工作将保存在云中的虚拟机上,但不会存储在 {% data variables.product.prodname_dotcom %} 上的存储库中。 + +可以保存文件、关闭并停止 codespace,稍后再返回工作。 通常会预安装 Git,工作目录将自动初始化为 Git 存储库,除非你从 {% data variables.product.company_short %} 的空白模板开始。 这意味着可以立即使用 Git 进行本地源代码管理,例如添加和提交文件。 + +但是,如果删除未发布的 codespace,或者该 codespace 由于在保持期内未使用而被自动删除,则你的工作也会被删除。 若要持久保存你的工作并允许其他人处理你的项目,你需要将 codespace 发布到 {% data variables.product.prodname_dotcom %} 上的存储库。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/application-installed-locally.md b/translations/zh-CN/data/reusables/codespaces/application-installed-locally.md new file mode 100644 index 0000000000..0cc519059d --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/application-installed-locally.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: cdcd2ca433a74eef0f9a768c6db21b9ac708ccd1 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159413" +--- +如果选择“{% data variables.product.prodname_vscode %}”或“JetBrains 网关”,则必须确保已在本地计算机上安装所选应用程序。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/codespace-logs.md b/translations/zh-CN/data/reusables/codespaces/codespace-logs.md new file mode 100644 index 0000000000..879b3b9286 --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/codespace-logs.md @@ -0,0 +1,11 @@ +--- +ms.openlocfilehash: 945a4c8f9249f6153a4fe51e4f53c2b4b16cf060 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159524" +--- +## 代码空间日志 + +这些日志包含有关 codespace、容器、会话和 {% data variables.product.prodname_vscode_shortname %} 环境的详细信息。 它们对于诊断连接问题和其他意外行为非常有用。 例如,代码空间冻结,但“Reload Windows(重新加载 Windows)”选项可将其解冻几分钟,或者您随机断开与代码空间的连接,但能够立即重新连接。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/codespaces-continue-by-paying.md b/translations/zh-CN/data/reusables/codespaces/codespaces-continue-by-paying.md new file mode 100644 index 0000000000..2f62db9c26 --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/codespaces-continue-by-paying.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: 73174295d5ab0a8f7b5fb9cebc3dbb4412409c3a +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159415" +--- +通过提供付款详细信息和设置支出限制,可以在超出每月包含的存储空间和计算使用量后继续使用 {% data variables.product.prodname_github_codespaces %}。 有关详细信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)”。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/codespaces-disabling-org-billing.md b/translations/zh-CN/data/reusables/codespaces/codespaces-disabling-org-billing.md index d5e6b42576..2e4ac2df23 100644 --- a/translations/zh-CN/data/reusables/codespaces/codespaces-disabling-org-billing.md +++ b/translations/zh-CN/data/reusables/codespaces/codespaces-disabling-org-billing.md @@ -1,5 +1,13 @@ +--- +ms.openlocfilehash: da45d9e5d01d2980559db0175157d03b2f7a454a +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159219" +--- {% note %} -**Note**: If you disable billing for {% data variables.product.prodname_github_codespaces %} for some organization members and collaborators, or for your entire organization, anyone who can either push changes to, or fork, a repository in your organization, will still be able to create a codespace for that repository by using their personal account. However, this will not incur any charge for your organization. For information about restricting access to a repository, see "[Managing teams and people with access to your repository](/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/managing-teams-and-people-with-access-to-your-repository)." +注意:如果为某些组织成员和协作者或整个组织禁用 {% data variables.product.prodname_github_codespaces %} 的计费,则任何可以将更改推送到组织中的存储库或创建分支的人仍然可以使用其个人帐户为该存储库创建 codespace。 但是,这不会对组织产生任何费用。 有关限制存储库访问的信息,请参阅“[管理有权访问存储库的团队和人员](/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/managing-teams-and-people-with-access-to-your-repository)”。 {% endnote %} diff --git a/translations/zh-CN/data/reusables/codespaces/codespaces-free-for-personal-intro.md b/translations/zh-CN/data/reusables/codespaces/codespaces-free-for-personal-intro.md new file mode 100644 index 0000000000..9e556b1f8c --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/codespaces-free-for-personal-intro.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: 1f6226c3fdf40ed1108934afd16966a9696a154d +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159491" +--- +{% data variables.product.prodname_github_codespaces %} 由组织、企业或个人帐户支付。 个人帐户的免费版和专业版计划包括免费使用 {% data variables.product.prodname_github_codespaces %},每月有最多固定使用量。 diff --git a/translations/zh-CN/data/reusables/codespaces/codespaces-jetbrains-beta-note.md b/translations/zh-CN/data/reusables/codespaces/codespaces-jetbrains-beta-note.md new file mode 100644 index 0000000000..5bac3bad03 --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/codespaces-jetbrains-beta-note.md @@ -0,0 +1,13 @@ +--- +ms.openlocfilehash: 7c6428ee82232f9609978bbb6f166623b1de6a6c +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159431" +--- +{% note %} + +注意:在 JetBrains IDE 中使用 {% data variables.product.prodname_github_codespaces %} 目前为公开 beta 版本,可能会随时发生更改。 + +{% endnote %} diff --git a/translations/zh-CN/data/reusables/codespaces/codespaces-machine-type-availability.md b/translations/zh-CN/data/reusables/codespaces/codespaces-machine-type-availability.md index 2d1c945b31..708ddb0f87 100644 --- a/translations/zh-CN/data/reusables/codespaces/codespaces-machine-type-availability.md +++ b/translations/zh-CN/data/reusables/codespaces/codespaces-machine-type-availability.md @@ -1,9 +1,9 @@ --- -ms.openlocfilehash: bde9df5c980a7448c30645675dc13086c1094fdc -ms.sourcegitcommit: fcf3546b7cc208155fb8acdf68b81be28afc3d2d +ms.openlocfilehash: 32a0269159f5f1556cd96d10ef75915fe84b05c0 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/11/2022 -ms.locfileid: "147882881" +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159428" --- -可供选择的计算机类型可能会受为组织配置的策略或存储库的计算机类型最低规范的限制。 有关详细信息,请参阅“[限制对计算机类型的访问](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)”和“[为代码空间计算机设置最低规范](/codespaces/setting-up-your-project-for-codespaces/setting-a-minimum-specification-for-codespace-machines)”。 +你选择的可用计算机类型可能会受到多种因素的限制。 其中可能包括为组织配置的策略,或者存储库的计算机类型最低规范。 有关详细信息,请参阅“[限制对计算机类型的访问](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)”和“[为代码空间计算机设置最低规范](/codespaces/setting-up-your-project-for-codespaces/setting-a-minimum-specification-for-codespace-machines)”。 diff --git a/translations/zh-CN/data/reusables/codespaces/codespaces-machine-types.md b/translations/zh-CN/data/reusables/codespaces/codespaces-machine-types.md index 9ab960d4cd..dd466cfd4c 100644 --- a/translations/zh-CN/data/reusables/codespaces/codespaces-machine-types.md +++ b/translations/zh-CN/data/reusables/codespaces/codespaces-machine-types.md @@ -1,11 +1,11 @@ --- -ms.openlocfilehash: 2a61633813730ae2a55d43d2d2cf976fda95784f -ms.sourcegitcommit: 47bd0e48c7dba1dde49baff60bc1eddc91ab10c5 +ms.openlocfilehash: 9e66c56694869bc5479af2930548104fe373ec12 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/05/2022 -ms.locfileid: "147111106" +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159520" --- -通常,你可以在选择的远程机器上运行 codespace,从 2 核到 32 核。 每种类型都有不同的资源水平和不同的计费等级。 有关信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)”。 +通常,你可以在选择的远程计算机上运行 codespace。 这些计算机类型有 2 核到 32 核的硬件规格可选,尽管各种计算机类型可能并不总是可用。 每种计算机类型都有不同的资源水平和不同的计费等级。 有关信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)”。 默认情况下,创建 codespace 时将使用具有最低有效资源的计算机类型。 diff --git a/translations/zh-CN/data/reusables/codespaces/codespaces-spending-limit-requirement.md b/translations/zh-CN/data/reusables/codespaces/codespaces-spending-limit-requirement.md index 9c886492a7..6872b5251c 100644 --- a/translations/zh-CN/data/reusables/codespaces/codespaces-spending-limit-requirement.md +++ b/translations/zh-CN/data/reusables/codespaces/codespaces-spending-limit-requirement.md @@ -1,7 +1,15 @@ +--- +ms.openlocfilehash: 7d64df6146c09aa6cd5fc997ccb96022fab29501 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159227" +--- {% note %} -**Note:** You must set a non-zero spending limit on your personal, organization, or enterprise account before the account can be billed for use of {% data variables.product.prodname_github_codespaces %}. +注意:必须为个人、组织或企业帐户设置非零支出限制,然后才能向帐户对 {% data variables.product.prodname_github_codespaces %} 的使用进行计费。 {% endnote %} -By default, all accounts have a {% data variables.product.prodname_github_codespaces %} spending limit of $0 USD. This prevents new codespaces being created, or existing codespaces being opened, if doing so would incur a billable cost to your personal, organization, or enterprise account. For personal accounts, codespaces can always be created and used if the account has not reached the limit of its monthly included usage. For organizations and enterprises, the default spending limit means that, to allow people to create codespaces that are billed to the organization, or its parent enterprise, the limit must be changed to a value above $0 USD. +默认情况下,所有帐户的 {% data variables.product.prodname_github_codespaces %} 支出限制为 0 美元。 这可以防止创建新的 codespace 或打开现有 codespace,如果执行这些操作,将对个人、组织或企业帐户产生可计费成本。 对于个人帐户,如果帐户尚未达到其每月包含的使用量限制,则始终可以创建和使用 codespace。 对于组织和企业,默认支出限制意味着,要允许用户创建向组织或其父企业计费的 codespace,必须将限制更改为高于 0 美元的值。 diff --git a/translations/zh-CN/data/reusables/codespaces/configuration-choice-templates.md b/translations/zh-CN/data/reusables/codespaces/configuration-choice-templates.md new file mode 100644 index 0000000000..50d0007e0d --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/configuration-choice-templates.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: 9a7f2eacb54b6133ec322f00ced9c0325747838c +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159414" +--- +当用户使用模板存储库中的“使用此模板”按钮创建 codespace 时,则无法选择配置。 codespace 将基于 `.devcontainer/devcontainer.json` 中或存储库根目录的 `.devcontainer.json` 中定义的默认配置进行生成。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/copilot-in-vscode.md b/translations/zh-CN/data/reusables/codespaces/copilot-in-vscode.md new file mode 100644 index 0000000000..d7262bc4a1 --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/copilot-in-vscode.md @@ -0,0 +1,17 @@ +--- +ms.openlocfilehash: 56d362df2d0dc32b709c6e6d9cc1b8910ac81be5 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159420" +--- +[{% data variables.product.prodname_copilot %}](https://copilot.github.com/) 是 AI 结对程序员,可用于任何 codespace。 有关详细信息,请参阅“[关于 GitHub Copilot](/copilot/overview-of-github-copilot/about-github-copilot)”。 + +若要开始在 {% data variables.product.prodname_github_codespaces %} 中使用 {% data variables.product.prodname_copilot %},请安装 [{% data variables.product.prodname_vscode_marketplace %} 中的 {% data variables.product.prodname_copilot %} 扩展](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot)。 + +若要在所有 codespace 中包含 {% data variables.product.prodname_copilot %} 或其他扩展,请启用“设置同步”。有关详细信息,请参阅“[为帐户个性化 {% data variables.product.prodname_github_codespaces %}](/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account#settings-sync)”。 此外,若要在所有用户的给定项目中加入 {% data variables.product.prodname_copilot %},可以将 `GitHub.copilot` 指定为 `devcontainer.json` 文件中的扩展。 有关配置 `devcontainer.json` 文件的信息,请参阅“[开发容器简介](/codespaces/customizing-your-codespace/configuring-codespaces-for-your-project#creating-a-custom-dev-container-configuration)”。 + +## 延伸阅读 + +- “[在 Visual Studio Code 中开始使用 GitHub Copilot](/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-visual-studio-code)” \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/creating-a-codespace-in-vscode.md b/translations/zh-CN/data/reusables/codespaces/creating-a-codespace-in-vscode.md index 3dafc1ad37..083f7f92e9 100644 --- a/translations/zh-CN/data/reusables/codespaces/creating-a-codespace-in-vscode.md +++ b/translations/zh-CN/data/reusables/codespaces/creating-a-codespace-in-vscode.md @@ -1,30 +1,38 @@ -After you connect your account on {% data variables.product.prodname_dotcom_the_website %} to the {% data variables.product.prodname_github_codespaces %} extension, you can create a new codespace. For more information about the {% data variables.product.prodname_github_codespaces %} extension, see the [{% data variables.product.prodname_vs_marketplace_shortname %}](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces). +--- +ms.openlocfilehash: d8f0e4e19ba362881f261a214aa56666f5902979 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148158579" +--- +将 {% data variables.product.prodname_dotcom_the_website %} 上的帐户连接到 {% data variables.product.prodname_github_codespaces %} 扩展后,可以创建新的 codespace。 有关 {% data variables.product.prodname_github_codespaces %} 扩展的详细信息,请参阅 [{% data variables.product.prodname_vs_marketplace_shortname %}](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces)。 {% data reusables.codespaces.click-remote-explorer-icon-vscode %} -2. Click the Add icon: {% octicon "plus" aria-label="The plus icon" %}. +2. 单击“添加”图标:{% octicon "plus" aria-label="The plus icon" %}。 - ![The Create new Codespace option in {% data variables.product.prodname_github_codespaces %}](/assets/images/help/codespaces/create-codespace-vscode.png) + ![{% data variables.product.prodname_github_codespaces %} 中的“新建 Codespace”选项](/assets/images/help/codespaces/create-codespace-vscode.png) -3. Type the name of the repository you want to develop in, then select it. +3. 键入要在其中开发的存储库的名称,然后将其选中。 - ![Searching for repository to create a new codespace](/assets/images/help/codespaces/choose-repository-vscode.png) + ![搜索要在其中新建 codespace 的存储库](/assets/images/help/codespaces/choose-repository-vscode.png) - If the repository you choose is owned by an organization, and the organization has configured codespaces for this repository to be billable to the organization, or its parent enterprise, a message will be displayed in subsequent prompts telling you who will pay for the codespace. + 如果你选择的存储库归组织所有,并且该组织已将此存储库的 codespace 配置为可向组织或其父企业计费,则后续提示中会显示一条消息,告知谁将支付 codespace 费用。 -4. Click the branch you want to develop on. +4. 单击要在其中开发的分支。 - ![Searching for a branch to create a new codespace](/assets/images/help/codespaces/choose-branch-vscode.png) + ![搜索要在其中新建 codespace 的分支](/assets/images/help/codespaces/choose-branch-vscode.png) -5. If prompted to choose a dev container configuration file, choose a file from the list. +5. 如果系统提示选择开发容器配置文件,请从列表中选择一个文件。 - ![Choosing a dev container configuration file for {% data variables.product.prodname_github_codespaces %}](/assets/images/help/codespaces/choose-dev-container-vscode.png) + ![为 {% data variables.product.prodname_github_codespaces %} 选择一个开发容器配置文件](/assets/images/help/codespaces/choose-dev-container-vscode.png) -6. Click the machine type you want to use. +6. 选择你要使用的机器类型。 - ![Instance types for a new codespace](/assets/images/help/codespaces/choose-sku-vscode.png) + ![新 codespace 的实例类型](/assets/images/help/codespaces/choose-sku-vscode.png) {% note %} - **Note**: {% data reusables.codespaces.codespaces-machine-type-availability %} + 注意:{% data reusables.codespaces.codespaces-machine-type-availability %} {% endnote %} diff --git a/translations/zh-CN/data/reusables/codespaces/developing-in-vscode.md b/translations/zh-CN/data/reusables/codespaces/developing-in-vscode.md new file mode 100644 index 0000000000..f57de9ba2b --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/developing-in-vscode.md @@ -0,0 +1,26 @@ +--- +ms.openlocfilehash: 71aea4a0d9c72885e56e7aef5a20b36bf817fec5 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159475" +--- +### 自定义存储库的 codespace + +可以通过创建或更新存储库的开发容器配置来自定义为存储库创建的 codespace。 可以从 codespace 中执行此操作。 更改开发容器配置后,可以通过为 codespace 重新生成 Docker 容器来将更改应用于当前 codespace。 有关详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)”。 + +### 个性化代码空间 + +可以使用 [dotfiles](https://dotfiles.github.io/tutorials/) 存储库和[设置同步](https://code.visualstudio.com/docs/editor/settings-sync)为创建的任何 codespace 个性化 codespace 环境的各个方面。 个性化可以包括 shell 首选项和其他工具。 有关详细信息,请参阅“[为帐户设置个性化的 {% data variables.product.prodname_codespaces %}](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account)”。 + +### 从代码空间运行应用程序 +{% data reusables.codespaces.about-port-forwarding %} 有关详细信息,请参阅“[转发 codespace 中的端口](/github/developing-online-with-codespaces/forwarding-ports-in-your-codespace)”。 + +### 提交更改 + +{% data reusables.codespaces.committing-link-to-procedure %} + +### 使用 {% data variables.product.prodname_vscode_command_palette %} + +{% data variables.product.prodname_vscode_command_palette %} 允许你访问和管理 {% data variables.product.prodname_codespaces %} 和 {% data variables.product.prodname_vscode %} 的许多功能。 有关详细信息,请参阅“[在 {% data variables.product.prodname_codespaces %} 中使用 {% data variables.product.prodname_vscode_command_palette %}](/codespaces/codespaces-reference/using-the-vs-code-command-palette-in-codespaces)”。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/edit-devcontainer-json.md b/translations/zh-CN/data/reusables/codespaces/edit-devcontainer-json.md index 7f13b596d0..44f998b951 100644 --- a/translations/zh-CN/data/reusables/codespaces/edit-devcontainer-json.md +++ b/translations/zh-CN/data/reusables/codespaces/edit-devcontainer-json.md @@ -1,9 +1,9 @@ --- -ms.openlocfilehash: 38208812f73fda89c12d251955a1eee327ceb8db -ms.sourcegitcommit: 27882d9b3f19979c817c25952a2fb4dc4c6f0a65 +ms.openlocfilehash: 363a170cc5f062ac400e868eb920e1e035ac8fd8 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 10/27/2022 -ms.locfileid: "148113990" +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159139" --- -1. 存储库的 {% data variables.product.prodname_github_codespaces %} 在 `devcontainer.json` 文件中配置。 如果存储库尚未包含 `devcontainer.json` 文件,请立即添加一个。 请参阅“[将开发容器配置添加到存储库](/free-pro-team@latest/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces)”。 \ No newline at end of file +1. 存储库的 {% data variables.product.prodname_github_codespaces %} 可在 `devcontainer.json` 文件中配置。 如果存储库尚未包含 `devcontainer.json` 文件,可以立即添加一个。 请参阅“[将开发容器配置添加到存储库](/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces)”。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/exporting-changes.md b/translations/zh-CN/data/reusables/codespaces/exporting-changes.md index 46a94526d8..694eaa303f 100644 --- a/translations/zh-CN/data/reusables/codespaces/exporting-changes.md +++ b/translations/zh-CN/data/reusables/codespaces/exporting-changes.md @@ -1,9 +1,9 @@ --- -ms.openlocfilehash: dbfc559ca9be38d03d5bcd7c884687f098025ea9 -ms.sourcegitcommit: fb047f9450b41b24afc43d9512a5db2a2b750a2a +ms.openlocfilehash: 63705338500bed176d013288ee7b091e593300ec +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/11/2022 -ms.locfileid: "145098731" +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148158603" --- -如果达到支出限制,你将无法再创建或恢复 codespace。 你仍然可以[将任何正在进行的更改导出到新分支](/codespaces/troubleshooting/exporting-changes-to-a-branch)。 +如果个人、组织或企业帐户达到其支出限制,则无法再创建或恢复可向该帐户计费的 codespace。 但你仍然可以将任何正在进行的更改导出到新分支。 有关详细信息,请参阅“[将更改导出到分支](/codespaces/troubleshooting/exporting-changes-to-a-branch)”。 diff --git a/translations/zh-CN/data/reusables/codespaces/gpg-in-active-codespaces.md b/translations/zh-CN/data/reusables/codespaces/gpg-in-active-codespaces.md new file mode 100644 index 0000000000..cb24b98a9c --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/gpg-in-active-codespaces.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: 9f5ba15be4cbdf524f825469d291bd3df970f974 +ms.sourcegitcommit: 47e03737d09bed84dfedb7be5924d893d34ea1a8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/16/2022 +ms.locfileid: "148167108" +--- +启用 GPG 验证后,它将在从相关存储库创建的任何新 codespace 中自动生效。 要使 GPG 验证在现有活动 codespace 中生效,需要停止并重启 codespace。 有关详细信息,请参阅“[停止和启动 codespace](/codespaces/developing-in-codespaces/stopping-and-starting-a-codespace)”。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/jetbrains-open-codespace-plugin.md b/translations/zh-CN/data/reusables/codespaces/jetbrains-open-codespace-plugin.md new file mode 100644 index 0000000000..4f16ea8802 --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/jetbrains-open-codespace-plugin.md @@ -0,0 +1,11 @@ +--- +ms.openlocfilehash: f9f3e238032c9256fa1d6e5432c79e2736a5a30a +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159516" +--- +1. 在 JetBrains 客户端中,单击 {% data variables.product.prodname_github_codespaces %} 插件以显示 {% data variables.product.prodname_github_codespaces %} 工具窗口。 + + ![{% data variables.product.prodname_github_codespaces %} 工具窗口的屏幕截图](/assets/images/help/codespaces/jetbrains-codespaces-tool-window.png) diff --git a/translations/zh-CN/data/reusables/codespaces/jupyterlab-in-default-image.md b/translations/zh-CN/data/reusables/codespaces/jupyterlab-in-default-image.md new file mode 100644 index 0000000000..a4c43fcfbd --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/jupyterlab-in-default-image.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: c3900e59c91a3d0afd192b5ff948b612bfe0ba64 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159473" +--- +默认容器映像包括 JupyterLab,因此从默认映像创建的 codespaces 将始终安装 JupyterLab。 有关默认映像的详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#using-the-default-dev-container-configuration)”和 [`devcontainers/images` 存储库](https://github.com/devcontainers/images/tree/main/src/universal)。 如果未在开发容器配置中使用默认映像,则可以通过将 `ghcr.io/devcontainers/features/python` 功能添加到 `devcontainer.json` 文件来安装 JupyterLab。 应该包括选项 `"installJupyterlab": true`。 有关详细信息,请参阅 `devcontainers/features` 存储库中的 [`python` 功能自述文件](https://github.com/devcontainers/features/tree/main/src/python#python-python)。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/jupyterlab-installed-in-codespace.md b/translations/zh-CN/data/reusables/codespaces/jupyterlab-installed-in-codespace.md new file mode 100644 index 0000000000..d5b7b3a581 --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/jupyterlab-installed-in-codespace.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: 1e6e9e375bb024561c279007909ab7a46f47b8a9 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159489" +--- +JupyterLab 应用程序必须安装在要打开的 Codespace 中。 {% data reusables.codespaces.jupyterlab-in-default-image %} \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/links-to-get-started.md b/translations/zh-CN/data/reusables/codespaces/links-to-get-started.md index 8f5e9a6fea..3d96903201 100644 --- a/translations/zh-CN/data/reusables/codespaces/links-to-get-started.md +++ b/translations/zh-CN/data/reusables/codespaces/links-to-get-started.md @@ -1,9 +1,9 @@ --- -ms.openlocfilehash: 6d1607f3c2d1c775f5328d13ff4cb458d82037a0 -ms.sourcegitcommit: f638d569cd4f0dd6d0fb967818267992c0499110 +ms.openlocfilehash: b942594848833f5ccdeba0f4f6388e463591eac6 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 10/25/2022 -ms.locfileid: "148108153" +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148158947" --- -要开始使用 {% data variables.product.prodname_github_codespaces %},请参阅“[{% data variables.product.prodname_github_codespaces %} 快速入门](/codespaces/getting-started/quickstart)”。 有关创建或重新打开 codespace 的详细信息,请参阅“[创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace)”和“[打开现有的 codespace](/codespaces/developing-in-codespaces/opening-an-existing-codespace)”。 要详细了解 {% data variables.product.prodname_github_codespaces %} 的工作原理,请参阅“[深入了解 {% data variables.product.prodname_github_codespaces %}](/codespaces/getting-started/deep-dive)”。 +要开始使用 {% data variables.product.prodname_github_codespaces %},请参阅“[{% data variables.product.prodname_github_codespaces %} 快速入门](/codespaces/getting-started/quickstart)”。 有关创建 codespace 的详细信息,请参阅“[为存储库创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository)”或“[通过模板创建 codespace](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template)”。 如果要返回到已创建的 codespace,请参阅“[打开现有 codespace](/codespaces/developing-in-codespaces/opening-an-existing-codespace)”。 要详细了解 {% data variables.product.prodname_github_codespaces %} 的工作原理,请参阅“[深入了解 {% data variables.product.prodname_github_codespaces %}](/codespaces/getting-started/deep-dive)”。 diff --git a/translations/zh-CN/data/reusables/codespaces/machine-types-for-unpublished-codespaces.md b/translations/zh-CN/data/reusables/codespaces/machine-types-for-unpublished-codespaces.md new file mode 100644 index 0000000000..cbe5d2b11e --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/machine-types-for-unpublished-codespaces.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: 2511362f6aa19d917b5cf8488a368c9dd52b09a1 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159457" +--- +未发布的 codespace(使用模板创建且未链接到 {% data variables.product.product_name %} 上存储库的 codespace)始终在具有相同规范的虚拟机上运行。 无法更改未发布的 codespace 的计算机类型。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/monthly-spending-limit-codespaces.md b/translations/zh-CN/data/reusables/codespaces/monthly-spending-limit-codespaces.md new file mode 100644 index 0000000000..4b51137d9a --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/monthly-spending-limit-codespaces.md @@ -0,0 +1,11 @@ +--- +ms.openlocfilehash: 78eee4151cf6c88b83875b990e895707127e5421 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159481" +--- +1. 在“Codespaces”下,选择限制支出或允许无限支出。 + + ![用于限制支出或允许无限支出的单选按钮的屏幕截图](/assets/images/help/billing/limit-or-unlimited-codespaces.png) diff --git a/translations/zh-CN/data/reusables/codespaces/navigating-to-a-codespace.md b/translations/zh-CN/data/reusables/codespaces/navigating-to-a-codespace.md new file mode 100644 index 0000000000..c0ac366782 --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/navigating-to-a-codespace.md @@ -0,0 +1,16 @@ +--- +ms.openlocfilehash: 3263bcf4439cdee99cbf589dde18dcb92af1ec00 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159518" +--- +## 导航到现有代码空间 + +1. {% data reusables.codespaces.you-can-see-all-your-codespaces %} +1. 单击您要在其中开发的代码空间的名称。 + + ![Codespace 的名称](/assets/images/help/codespaces/click-name-codespace.png) + +或者,你可以通过导航到该存储库并选择“{% octicon "code" aria-label="The code icon" %} 代码”来查看特定存储库的任何 codespace。 下拉菜单将显示存储库中所有处于活动状态的 codespace。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/open-template-in-codespace-step.md b/translations/zh-CN/data/reusables/codespaces/open-template-in-codespace-step.md new file mode 100644 index 0000000000..09837ec56f --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/open-template-in-codespace-step.md @@ -0,0 +1,11 @@ +--- +ms.openlocfilehash: 0193cb7b3950276f157e8ef2a84a958278cfc800 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159509" +--- +1. 在文件列表上方,单击“使用此模板”,然后选择“在 codespace 中打开” 。 + + ![使用此模板按钮](/assets/images/help/repository/use-this-template-button.png) \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/opening-codespace-in-jetbrains.md b/translations/zh-CN/data/reusables/codespaces/opening-codespace-in-jetbrains.md new file mode 100644 index 0000000000..3710834cff --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/opening-codespace-in-jetbrains.md @@ -0,0 +1,34 @@ +--- +ms.openlocfilehash: 52206649d45bd9d76bcc593adeffa47318a70880 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159508" +--- +如果已将 JetBrains 网关设置为默认编辑器,则在从 {% data variables.product.prodname_dotcom_the_website %} 打开 codespace 时,网关将自动启动。 + +如果 JetBrains 网关不是默认编辑器,你仍然可以在 JetBrains 中打开 codespace,方法是转到 [github.com/codespaces](https://github.com/codespaces) 的“你的 codespace”页,然后单击要打开的 codespace 右侧的省略号 (...)。 有关详细信息,请参阅“[打开现有 codespace](/codespaces/developing-in-codespaces/opening-an-existing-codespace?tool=webui)”。 + +或者,也可以打开 JetBrains 网关并选择现有 codespace,如以下过程所述。 + +1. 打开 JetBrains 网关应用程序。 +1. 单击“连接到 {% data variables.product.prodname_codespaces %}”。 + + ![JetBrains 网关初始视图的屏幕截图](/assets/images/help/codespaces/jetbrains-gateway-connect.png) + +1. 在“你的 Codespace”列表中,单击要处理的 codespace。 + + ![JetBrains 网关 codespace 列表的屏幕截图](/assets/images/help/codespaces/jetbrains-gateway-codespaces.png) + +1. 在“可用 IDE”列表中,单击要使用的 JetBrains IDE。 下次连接到 codespace 时,网关将记住你的选择。 + + ![JetBrains 网关 codespace 列表的屏幕截图](/assets/images/help/codespaces/jetbrains-gateway-ides.png) + +1. 单击“连接” 。 + + {% note %} + + **注意**:如果运行的是防火墙:首次连接到远程资源时,系统可能会提示允许 JetBrains 网关跨网络通信。 + + {% endnote %} diff --git a/translations/zh-CN/data/reusables/codespaces/port-forwarding-adding-non-jetbrains.md b/translations/zh-CN/data/reusables/codespaces/port-forwarding-adding-non-jetbrains.md new file mode 100644 index 0000000000..656b5758f3 --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/port-forwarding-adding-non-jetbrains.md @@ -0,0 +1,17 @@ +--- +ms.openlocfilehash: 5aef043edaeaf981964defece5a3a008a89ee5b8 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159502" +--- +## 将端口添加到代码空间配置 + +你可以将转发的端口添加到存储库的 {% data variables.product.prodname_github_codespaces %} 配置中,因此该端口将自动为从存储库创建的所有 codespace 转发。 更新配置后,必须重建任何以前创建的代码空间以应用更改。 有关详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#applying-configuration-changes-to-a-codespace)”。 + +可以使用 `forwardPorts` 属性在 `.devcontainer.json` 文件中手动配置转发端口,也可以在浏览器中已打开的 codespace 或 {% data variables.product.prodname_vscode_shortname %} 桌面应用程序中使用“端口”面板。 + +{% data reusables.codespaces.navigate-to-ports-tab %} +1. 右键单击要添加到 codespace 配置的端口,然后单击“设置标签并更新 devcontainer.json”。 + ![右键菜单中设置标签并将端口添加到 devcontainer.json 的选项](/assets/images/help/codespaces/update-devcontainer-to-add-port-option.png) {% data reusables.codespaces.type-port-label %} \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/port-forwarding-labeling-non-jetbrains.md b/translations/zh-CN/data/reusables/codespaces/port-forwarding-labeling-non-jetbrains.md new file mode 100644 index 0000000000..69d5d0ad0b --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/port-forwarding-labeling-non-jetbrains.md @@ -0,0 +1,15 @@ +--- +ms.openlocfilehash: b85601bfdb4f5333e435878cba013882ed9c7f74 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159466" +--- +## 标记端口 + +在浏览器或 {% data variables.product.prodname_vscode_shortname %} 桌面应用程序中打开 codespace 时,可以标记转发的端口,以便在列表中更容易地识别它。 + +{% data reusables.codespaces.navigate-to-ports-tab %} +1. 悬停在要标记的端口上,然后单击标签图标。 + ![端口的标签图标](/assets/images/help/codespaces/label-icon.png) {% data reusables.codespaces.type-port-label %} \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/prebuilds-permission-authorization.md b/translations/zh-CN/data/reusables/codespaces/prebuilds-permission-authorization.md index ddfbefe4b1..4b9074dcb6 100644 --- a/translations/zh-CN/data/reusables/codespaces/prebuilds-permission-authorization.md +++ b/translations/zh-CN/data/reusables/codespaces/prebuilds-permission-authorization.md @@ -1,10 +1,10 @@ --- -ms.openlocfilehash: c32a9f6f6a799c3653cb17fe89721090fc01d155 -ms.sourcegitcommit: f638d569cd4f0dd6d0fb967818267992c0499110 +ms.openlocfilehash: bb81ad72418e81366595d963296493a7a3b55202 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 10/25/2022 -ms.locfileid: "148108150" +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148158675" --- 如果存储库的开发容器配置指定了访问其他存储库的权限,你将看到一个授权页面。 有关如何在 `devcontainer.json` 文件中指定此权限的详细信息,请参阅“[管理对 codespace 中其他存储库的访问](/codespaces/managing-your-codespaces/managing-repository-access-for-your-codespaces)”。 diff --git a/translations/zh-CN/data/reusables/codespaces/publishing-template-codespaces.md b/translations/zh-CN/data/reusables/codespaces/publishing-template-codespaces.md new file mode 100644 index 0000000000..d2e9a8841c --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/publishing-template-codespaces.md @@ -0,0 +1,34 @@ +--- +ms.openlocfilehash: a78c61511f0daa225bc27576a2ab57e8e1bea939 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159501" +--- +如果你使用的是 codespace,可以从 {% data variables.product.prodname_vscode_shortname %} Web 客户端或桌面应用程序发布它。 + +{% data reusables.codespaces.source-control-display-dark %} +1. 若要暂存更改,请单击已添加或更改文件旁边的 +,如果你更改了多个文件并希望全部暂存,请单击“更改”旁边的按钮 。 + + ![突出显示的暂存按钮的源代码管理侧栏](/assets/images/help/codespaces/codespaces-commit-stage.png) + + {% note %} + + 注意: 如果从 {% data variables.product.company_short %} 的空白模板开始,则不会看到更改列表,除非已将目录初始化为 Git 存储库。 若要发布从空白模板创建的 codespace,请在“源代码管理”视图中单击“发布到 {% data variables.product.company_short %}”,然后跳到步骤 5。 + + {% endnote %} +2. 若要提交暂存更改,请键入描述所做更改的提交消息,然后单击“提交”。 + + ![包含提交消息的源代码管理侧栏](/assets/images/help/codespaces/vscode-commit-button.png) +3. 单击“发布分支”。 + + ![VS Code 中“发布分支”按钮的屏幕截图](/assets/images/help/codespaces/vscode-publish-branch-button.png) +4. 在“存储库名称”下拉列表中,键入新存储库的名称,然后选择“发布到 {% data variables.product.company_short %} 专用存储库”或“发布到 {% data variables.product.company_short %} 公共存储库”。 + + ![VS Code 中“存储库名称”下拉列表的屏幕截图](/assets/images/help/codespaces/choose-new-repository.png) + + 新存储库的所有者将是创建 codespace 时所使用的 {% data variables.product.prodname_dotcom %} 帐户。 +5. (可选)在编辑器右下角显示的弹出窗口中,单击“在 {% data variables.product.company_short %} 上打开”,查看 {% data variables.product.prodname_dotcom_the_website %} 上的新存储库。 + + ![VS Code 中“在 GitHub 中打开”弹出窗口的屏幕截图](/assets/images/help/codespaces/open-on-github.png) \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/rebuild-command.md b/translations/zh-CN/data/reusables/codespaces/rebuild-command.md index 5247bdfa0f..e60ef5447f 100644 --- a/translations/zh-CN/data/reusables/codespaces/rebuild-command.md +++ b/translations/zh-CN/data/reusables/codespaces/rebuild-command.md @@ -1,3 +1,5 @@ 1. Access the {% data variables.product.prodname_vscode_command_palette_shortname %} (Shift+Command+P (Mac) / Ctrl+Shift+P (Windows/Linux)), then start typing "rebuild". Select **Codespaces: Rebuild Container**. - ![Rebuild container option](/assets/images/help/codespaces/codespaces-rebuild.png) + ![Screenshot of Rebuild Container command in the Command Pallette](/assets/images/help/codespaces/codespaces-rebuild.png) + + {% indented_data_reference reusables.codespaces.full-rebuild-tip %} diff --git a/translations/zh-CN/data/reusables/codespaces/setting-up-project-intro.md b/translations/zh-CN/data/reusables/codespaces/setting-up-project-intro.md new file mode 100644 index 0000000000..f1e14f2218 --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/setting-up-project-intro.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: 21daaf99777a364391eb83e7c9addbd0d1947265 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159429" +--- +在 {% data variables.product.prodname_codespaces %} 中,使用 {% data variables.product.prodname_vscode %} 桌面应用程序,或 {% data variables.product.prodname_vscode_shortname %} Web 客户端。 这样会向你演示在 codespace 中打开项目,以及添加和修改预定义开发容器配置的示例。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/setup-custom-devcontainer.md b/translations/zh-CN/data/reusables/codespaces/setup-custom-devcontainer.md index 051877527d..4accd368fa 100644 --- a/translations/zh-CN/data/reusables/codespaces/setup-custom-devcontainer.md +++ b/translations/zh-CN/data/reusables/codespaces/setup-custom-devcontainer.md @@ -1,9 +1,9 @@ --- -ms.openlocfilehash: 8fce179b1aa62f79737c46329d11f3e375dc375c -ms.sourcegitcommit: 80842b4e4c500daa051eff0ccd7cde91c2d4bb36 +ms.openlocfilehash: 7c8d446316e97bed4e63b3eb5ae7b8f9b1e4da40 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/12/2022 -ms.locfileid: "147060294" +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159426" --- -若要将存储库设置为使用自定义开发容器,需要创建一个或多个 `devcontainer.json` 文件。 可以在 {% data variables.product.prodname_vscode %} 中从模板中添加这些文件,也可以自行编写。 有关开发容器配置的详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)”。 +若要将存储库设置为使用自定义开发容器,需要创建一个或多个 `devcontainer.json` 文件。 可以在 {% data variables.product.prodname_vscode %} 中从预定义配置模板中添加这些文件,也可以自行编写。 有关开发容器配置的详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)”。 diff --git a/translations/zh-CN/data/reusables/codespaces/source-control-commit-changes.md b/translations/zh-CN/data/reusables/codespaces/source-control-commit-changes.md index 2307c2e992..54c37e1e4f 100644 --- a/translations/zh-CN/data/reusables/codespaces/source-control-commit-changes.md +++ b/translations/zh-CN/data/reusables/codespaces/source-control-commit-changes.md @@ -1,15 +1,15 @@ --- -ms.openlocfilehash: 8cb17c6661826a0d46c37436b05b9f694541dab1 -ms.sourcegitcommit: fcf3546b7cc208155fb8acdf68b81be28afc3d2d +ms.openlocfilehash: 0591199ee1d92622aaef5c89e7dcc3d1eab89bfe +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/10/2022 -ms.locfileid: "145129978" +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159507" --- {% data reusables.codespaces.source-control-display-dark %} 1. 若要暂存更改,请单击已更改文件旁边的 +,如果你更改了多个文件并希望全部暂存,请单击“更改”旁边的按钮 。 -![突出显示的暂存按钮的源代码管理侧栏](/assets/images/help/codespaces/codespaces-commit-stage.png) +![突出显示“暂存”按钮的源代码管理侧边栏](/assets/images/help/codespaces/codespaces-commit-stage.png) 1. 输入提交消息,描述您所做的更改。 -![包含提交消息的源代码管理侧栏](/assets/images/help/codespaces/codespaces-commit-commit-message.png) -1. 要提交暂存的更改,请单击源控制侧栏顶部的复选标记。 +![包含提交消息的源代码管理侧边栏](/assets/images/help/codespaces/codespaces-commit-commit-message.png) +1. 若要提交暂存更改,请单击源代码管理侧边栏顶部的复选标记。 ![单击复选标记图标](/assets/images/help/codespaces/codespaces-commit-checkmark-icon.png) diff --git a/translations/zh-CN/data/reusables/codespaces/source-control-pull-request.md b/translations/zh-CN/data/reusables/codespaces/source-control-pull-request.md index 036e4e9fdc..5154ae1420 100644 --- a/translations/zh-CN/data/reusables/codespaces/source-control-pull-request.md +++ b/translations/zh-CN/data/reusables/codespaces/source-control-pull-request.md @@ -1,13 +1,13 @@ --- -ms.openlocfilehash: 32ab6120ced32f068eda9d9b9b1823352685f4ed -ms.sourcegitcommit: 1309b46201604c190c63bfee47dce559003899bf +ms.openlocfilehash: fe4475ec888b22062f49db7a8e87034125a35c94 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/10/2022 -ms.locfileid: "145129973" +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159411" --- 1. 提交存储库本地副本的更改后,单击“创建拉取请求”图标。 -![突出显示暂存按钮的源代码控制侧边栏](/assets/images/help/codespaces/codespaces-commit-pr-button.png) +![突出显示“暂存”按钮的源代码管理边栏](/assets/images/help/codespaces/codespaces-commit-pr-button.png) 1. 检查作为合并来源的本地分支和仓库以及作为合并目标的远程分支和仓库是否正确。 然后为拉取请求提供标题和描述。 -![突出显示暂存按钮的源代码控制侧边栏](/assets/images/help/codespaces/codespaces-commit-pr.png) -1. 单击“创建”。 +![突出显示“暂存”按钮的源代码管理边栏](/assets/images/help/codespaces/codespaces-commit-pr.png) +1. 单击“**创建**”。 diff --git a/translations/zh-CN/data/reusables/codespaces/source-control.md b/translations/zh-CN/data/reusables/codespaces/source-control.md new file mode 100644 index 0000000000..a4fdb7ee0b --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/source-control.md @@ -0,0 +1,63 @@ +--- +ms.openlocfilehash: c760b3f26f89437d485cc222de4fbc54fa907735 +ms.sourcegitcommit: f464cc9bfc41132f315ea172c591bfd145a06736 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/15/2022 +ms.locfileid: "148165458" +--- +## 发布从模板创建的 Codespace + +通过模板存储库或“你的 Codespace”页上的模板创建 Codespace 时,所做的工作不会存储在 {% data variables.product.prodname_dotcom %} 上的存储库中,直到你发布 Codespace。 有关详细信息,请参阅“[从模板创建 Codespace](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template#publishing-to-a-repository-on-github)”。 + +{% data reusables.codespaces.publishing-template-codespaces %} + +## 创建或切换分支 + +{% data reusables.codespaces.create-or-switch-branch %} + +{% tip %} + +提示:如果有人最近在远程存储库上更改了文件,则在你切换到的分支中,只有将更改拉取到 codespace 中之后,你才能看到这些更改。 + +{% endtip %} + +## 提交更改 + +{% data reusables.codespaces.source-control-commit-changes %} + +## 从远程仓库拉取更改 + +您可以随时将远程仓库的更改拉取到您的代码空间。 + +{% data reusables.codespaces.source-control-display-dark %} +1. 在侧栏顶部,单击省略号 (…)。![查看和更多操作的省略号按钮](/assets/images/help/codespaces/source-control-ellipsis-button.png) +1. 在下拉菜单中,单击“拉取”。 + +如果自创建代码空间以来开发容器配置已更改,则可以通过为代码空间重建容器来应用更改。 有关详细信息,请参阅“[开发容器简介](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project#applying-changes-to-your-configuration)”。 + +## 设置代码空间以自动获取新更改 + +您可以设置代码空间,以自动获取对远程仓库所做的任何新提交的详细信息。 这允许您查看仓库的本地副本是否过时,如果是,您可以选择拉取新的更改。 + +如果获取操作检测到远程仓库上的新更改,您将在状态栏中看到新提交的数量。 然后,您可以将更改拉取到本地副本。 + +1. 单击活动栏底部的“管理”按钮。 +![“管理”按钮](/assets/images/help/codespaces/manage-button.png) +1. 在菜单中,单击“设置”。 +1. 在设置页上,搜索:`autofetch`。 +![搜索自动获取](/assets/images/help/codespaces/autofetch-search.png) +1. 若要获取为当前存储库注册的所有远程更新的详细信息,请将 Git: Autofetch 设置为 `all`。 +![启用 Git 自动获取](/assets/images/help/codespaces/autofetch-all.png) +1. 如果要更改自动获取的间隔秒数,请编辑 Git: Autofetch Period 的值。 + +## 提出拉取请求 + +{% data reusables.codespaces.source-control-pull-request %} + +## 将更改推送到远程仓库 + +可以推送保存并提交的更改。 这将应用这些更改到远程仓库上的上游分支。 如果您尚未准备好创建拉取请求,或者希望在 {% data variables.product.prodname_dotcom %} 上创建拉取请求,则可能需要这样做。 + +1. 在侧栏顶部,单击省略号 (…)。![查看和更多操作的省略号按钮](/assets/images/help/codespaces/source-control-ellipsis-button-nochanges.png) +1. 在下拉菜单中,单击“推送”。 diff --git a/translations/zh-CN/data/reusables/codespaces/ssh-server-installed.md b/translations/zh-CN/data/reusables/codespaces/ssh-server-installed.md new file mode 100644 index 0000000000..e9afaad1ea --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/ssh-server-installed.md @@ -0,0 +1,19 @@ +--- +ms.openlocfilehash: 8c155db26d97e1f845638c790dd3cf1114eac47a +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159521" +--- +连接到的 codespace 必须运行 SSH 服务器。 默认容器映像包含一个可自动启动的 SSH 服务器。 如果未通过默认映像创建 codespace,可以通过将以下内容添加到 `devcontainer.json` 文件中的 `features` 对象来安装和启动 SSH 服务器。 + +```json +"features": { + ... + "ghcr.io/devcontainers/features/sshd:1": { + "version": "latest" + }, + ... +} +``` \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/starting-new-project-template.md b/translations/zh-CN/data/reusables/codespaces/starting-new-project-template.md new file mode 100644 index 0000000000..17e0b95285 --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/starting-new-project-template.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: 175259e6863efa78d746eef4f78de4acfa3bc6c7 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159465" +--- +如果要启动新项目,建议通过模板创建 codespace 并稍后将其发布到 {% data variables.product.product_name %} 上的存储库。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/stopping-a-codespace.md b/translations/zh-CN/data/reusables/codespaces/stopping-a-codespace.md index 5afaa37962..15150b1863 100644 --- a/translations/zh-CN/data/reusables/codespaces/stopping-a-codespace.md +++ b/translations/zh-CN/data/reusables/codespaces/stopping-a-codespace.md @@ -1,13 +1,13 @@ --- -ms.openlocfilehash: 5431cd0a877d3a87e4dd22fc3503bb9f67058b76 -ms.sourcegitcommit: f638d569cd4f0dd6d0fb967818267992c0499110 +ms.openlocfilehash: 4bdcc6ff93e7671d4dc368fc44784c963f549aae +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 10/25/2022 -ms.locfileid: "148108149" +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159043" --- -您可以随时停止代码空间。 停止代码空间时,将停止所有正在运行的进程并清除终端历史记录。 下次启动代码空间时,代码空间中的任何已保存更改仍将可用。 如果未明确停止代码空间,它将继续运行,直到它因非活动而超时。 有关详细信息,请参阅“[codespaces 超时](/codespaces/developing-in-codespaces/codespaces-lifecycle#codespaces-timeouts)”。 +您可以随时停止代码空间。 停止代码空间时,将停止所有正在运行的进程并清除终端历史记录。 下次启动代码空间时,代码空间中的任何已保存更改仍将可用。 如果未明确停止代码空间,它将继续运行,直到它因非活动而超时。 有关详细信息,请参阅“[codespace 生命周期](/codespaces/developing-in-codespaces/the-codespace-lifecycle#timeouts-for-github-codespaces)”。 -只有运行的代码空间才会产生 CPU 费用;停止的代码空间仅产生存储成本。 +只有运行的 codespace 才会产生 CPU 费用。 停止的 codespace 仅产生存储成本。 您可能希望停止并重新启动代码空间以对其应用更改。 例如,如果更改用于代码空间的计算机类型,则需要停止并重新启动它才能使更改生效。 您还可以停止代码空间,并在遇到错误或意外情况时选择重新启动或删除它。 diff --git a/translations/zh-CN/data/reusables/codespaces/template-codespaces-default-editor.md b/translations/zh-CN/data/reusables/codespaces/template-codespaces-default-editor.md new file mode 100644 index 0000000000..5e9a75ce52 --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/template-codespaces-default-editor.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: 56dc7f61a1ed68ffdb7e90f7edae615a8e428cad +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159449" +--- +从模板创建新的 codespace 时,始终会在 {% data variables.product.prodname_vscode %} Web 客户端中打开它。 可以在任何受支持的编辑器中重新打开现有 codespace。 有关详细信息,请参阅“[打开现有 codespace](/codespaces/developing-in-codespaces/opening-an-existing-codespace)”。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/usage-report-download.md b/translations/zh-CN/data/reusables/codespaces/usage-report-download.md new file mode 100644 index 0000000000..4d5d794fef --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/usage-report-download.md @@ -0,0 +1,21 @@ +--- +ms.openlocfilehash: c03f2677064bae6362b21c172725d334a2b22994 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159499" +--- +1. (可选)在“本月使用情况”旁,单击“获取使用情况报表”,以获取包含下载 {% data variables.product.prodname_actions %}、{% data variables.product.prodname_registry %} 和 {% data variables.product.prodname_github_codespaces %} 存储使用情况 CSV 报表的链接的电子邮件。 电子邮件将发送到帐户的主要电子邮件地址。 可以选择报表是应涵盖过去 7、30、90 还是 180 天。 + + ![下载 CSV 报告](/assets/images/help/billing/actions-packages-report-download.png) + + 用于此报表的数据每天更新一次。 + + 若要查看 {% data variables.product.prodname_github_codespaces %} 计算使用情况和存储的成本,请筛选报表以仅显示 `Product` 列中包含“Codespaces”的行。 + + ![针对 {% data variables.product.prodname_codespaces %} 进行筛选的使用情况报表的屏幕截图](/assets/images/help/codespaces/CSV-usage-report.png) + + 若要仅查看创建、更新和存储预生成的成本,请筛选报表以仅显示 `Actions Workflow` 列中包含“创建 Codespaces 预生成”的行。 + + ![针对预生成进行筛选的使用情况报表的屏幕截图](/assets/images/help/codespaces/CSV-usage-report-prebuilds.png) diff --git a/translations/zh-CN/data/reusables/codespaces/use-chrome.md b/translations/zh-CN/data/reusables/codespaces/use-chrome.md index 6f841fb0a5..ea9b6ce5c0 100644 --- a/translations/zh-CN/data/reusables/codespaces/use-chrome.md +++ b/translations/zh-CN/data/reusables/codespaces/use-chrome.md @@ -1,2 +1,10 @@ +--- +ms.openlocfilehash: 28b050801ea07a3ef9a6644f45e9e987c9ed21a9 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159497" +--- -For the best experience with {% data variables.product.prodname_github_codespaces %}, we recommend using a Chromium-based browser, like Google Chrome or Microsoft Edge. +为获取 {% data variables.product.prodname_github_codespaces %} 最佳使用体验,建议使用基于 Chromium 的浏览器,如 Google Chrome 或 Microsoft Edge。 diff --git a/translations/zh-CN/data/reusables/codespaces/view-all-templates-step.md b/translations/zh-CN/data/reusables/codespaces/view-all-templates-step.md new file mode 100644 index 0000000000..25b2c40d3e --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/view-all-templates-step.md @@ -0,0 +1,11 @@ +--- +ms.openlocfilehash: 97424b3eef10bea63f1cb8006fc600107ab1a57b +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159427" +--- +1. 若要查看模板的完整列表,请在“浏览快速入门模板”下单击“查看全部”。 + + ![“浏览快速入门模板”部分的屏幕截图,其中突出显示了“查看全部”](/assets/images/help/codespaces/codespace-templates-see-all.png) \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/codespaces/vscode-interface-annotation.md b/translations/zh-CN/data/reusables/codespaces/vscode-interface-annotation.md new file mode 100644 index 0000000000..393e080fc7 --- /dev/null +++ b/translations/zh-CN/data/reusables/codespaces/vscode-interface-annotation.md @@ -0,0 +1,13 @@ +--- +ms.openlocfilehash: e534b88265d2daba3b103080c5ed050adfb89459 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159498" +--- +1. 边栏 - 默认情况下,此区域在资源管理器中显示项目文件。 +2. 活动栏 - 这将显示视图并提供在它们之间切换的方法。 您可以通过拖放来重新排列视图。 +3. 编辑器 - 这是编辑文件的位置。 可以右键单击文件的选项卡以访问选项,例如在资源管理器中查找文件。 +4. 面板 - 这是可以查看输出和调试信息的位置,以及集成终端的默认位置。 +5. 状态栏 - 此区域提供有关 codespace 和项目的有用信息。 例如,分支名称、配置端口等。 diff --git a/translations/zh-CN/data/reusables/dependabot/dependabot-alerts-filters.md b/translations/zh-CN/data/reusables/dependabot/dependabot-alerts-filters.md new file mode 100644 index 0000000000..30e694b7a7 --- /dev/null +++ b/translations/zh-CN/data/reusables/dependabot/dependabot-alerts-filters.md @@ -0,0 +1,14 @@ +You can sort and filter {% data variables.product.prodname_dependabot_alerts %} by typing filters as `key:value` pairs into the search bar. + +| Option | Description | Example | +|:---|:---|:---| +| `ecosystem` | Displays alerts for the selected ecosystem | Use `ecosystem:npm` to show {% data variables.product.prodname_dependabot_alerts %} for npm |{% ifversion fpt or ghec or ghes > 3.5 or ghae > 3.5 %} +| `has` | Displays alerts meeting the selected filter criteria | Use `has:patch` to show alerts related to advisories that have a patch{% ifversion dependabot-alerts-vulnerable-calls %}
Use `has:vulnerable-calls` to show alerts relating to calls to vulnerable functions{% endif %} |{% endif %} +| `is` | Displays alerts based on their state | Use `is:open` to show open alerts | +| `manifest` | Displays alerts for the selected manifest | Use `manifest:webwolf/pom.xml` to show alerts on the pom.xml file of the webwolf application | +| `package` | Displays alerts for the selected package | Use `package:django` to show alerts for django | +| `resolution` | Displays alerts of the selected resolution status | Use `resolution:no-bandwidth` to show alerts previously parked due to lack of resources or time to fix them | +| `repo` | Displays alerts based on the repository they relate to
Note that this filter is only available on the security overview. For more information, see "[About the security overview](/code-security/security-overview/about-the-security-overview)" | Use `repo:octocat-repo` to show alerts in the repository called `octocat-repo` |{%- ifversion dependabot-alerts-development-label %} +| `scope` | Displays alerts based on the scope of the dependency they relate to | Use `scope:development` to show alerts for dependencies that are only used during development |{% endif %} +| `severity` | Displays alerts based on their level of severity | Use `severity:high` to show alerts with a severity of High |{%- ifversion dependabot-most-important-sort-option %} +| `sort` | Displays alerts according to the selected sort order | The default sorting option for alerts is `sort:most-important`, which ranks alerts by importance
Use `sort:newest` to show the latest alerts reported by {% data variables.product.prodname_dependabot %} |{% endif %} diff --git a/translations/zh-CN/data/reusables/education/note-on-student-codespaces-usage.md b/translations/zh-CN/data/reusables/education/note-on-student-codespaces-usage.md new file mode 100644 index 0000000000..1e73bc86dd --- /dev/null +++ b/translations/zh-CN/data/reusables/education/note-on-student-codespaces-usage.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: 5403ea0030ebd6bdcf072c1791f863ce9f73377e +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159495" +--- +如果学生在其 {% data variables.product.prodname_classroom %} 的作业存储库中使用 {% data variables.product.prodname_github_codespaces %},则使用费用由教室所属组织承担,不影响学生个人账户的使用。 diff --git a/translations/zh-CN/data/reusables/education/student-codespaces-benefit.md b/translations/zh-CN/data/reusables/education/student-codespaces-benefit.md new file mode 100644 index 0000000000..8f5436abe1 --- /dev/null +++ b/translations/zh-CN/data/reusables/education/student-codespaces-benefit.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: 3d5f9723fc9c1778d8e98d24b3997710a468c12b +ms.sourcegitcommit: aa67bb5ad7aa6804c5def4390e30adcc7cf96ea1 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/15/2022 +ms.locfileid: "148165191" +--- +经过验证的学生可以免费使用其个人帐户的 {% data variables.product.prodname_github_codespaces %},每月最多可使用 180 个核心小时。 学生每月可用的存储量和核心使用小时数相当于 {% data variables.product.prodname_pro %} 帐户中包含的量。 有关详细信息,请参阅“[关于 {% data variables.product.prodname_github_codespaces %} 的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)”。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/enterprise-accounts/emu-azure-admin-consent.md b/translations/zh-CN/data/reusables/enterprise-accounts/emu-azure-admin-consent.md index 6251598300..1b68756a7d 100644 --- a/translations/zh-CN/data/reusables/enterprise-accounts/emu-azure-admin-consent.md +++ b/translations/zh-CN/data/reusables/enterprise-accounts/emu-azure-admin-consent.md @@ -1,14 +1,6 @@ ---- -ms.openlocfilehash: 75ac89c3c50225b0c930c6d603acf0d5c331597d -ms.sourcegitcommit: 47bd0e48c7dba1dde49baff60bc1eddc91ab10c5 -ms.translationtype: HT -ms.contentlocale: zh-CN -ms.lasthandoff: 09/05/2022 -ms.locfileid: "147067856" ---- -1. 重定向后,登录到标识提供者,然后按照说明授予同意并安装 {% data variables.product.prodname_emu_idp_oidc_application %} 应用程序。 +1. After {% data variables.product.product_name %} redirects you to your IdP, sign in, then follow the instructions to give consent and install the {% data variables.product.prodname_emu_idp_oidc_application %} application. After Azure AD asks for permissions for {% data variables.product.company_short %} {% data variables.product.prodname_emus %} with OIDC, enable **Consent on behalf of your organization**, then click **Accept**. {% warning %} - 警告:必须以具有全局管理员权限的用户身份登录到 Azure AD,才能同意安装 {% data variables.product.prodname_emu_idp_oidc_application %} 应用程序。 + **Warning:** You must sign in to Azure AD as a user with global admin rights in order to consent to the installation of the {% data variables.product.prodname_emu_idp_oidc_application %} application. {% endwarning %} diff --git a/translations/zh-CN/data/reusables/enterprise-accounts/oidc-beta-notice.md b/translations/zh-CN/data/reusables/enterprise-accounts/oidc-beta-notice.md deleted file mode 100644 index eb8629da5f..0000000000 --- a/translations/zh-CN/data/reusables/enterprise-accounts/oidc-beta-notice.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -ms.openlocfilehash: 212811ec85eac69f0a197bdd7b5002848a30a889 -ms.sourcegitcommit: 47bd0e48c7dba1dde49baff60bc1eddc91ab10c5 -ms.translationtype: HT -ms.contentlocale: zh-CN -ms.lasthandoff: 09/05/2022 -ms.locfileid: "147059880" ---- -{% note %} - -注意:对 {% data variables.product.prodname_emus %} 的 OpenID Connect (OIDC) 和条件访问策略 (CAP) 支持处于公共 beta 版本,仅适用于 Azure AD。 - -{% endnote %} diff --git a/translations/zh-CN/data/reusables/enterprise-accounts/settings-tab.md b/translations/zh-CN/data/reusables/enterprise-accounts/settings-tab.md index 17d9803af6..aefe4eb4f6 100644 --- a/translations/zh-CN/data/reusables/enterprise-accounts/settings-tab.md +++ b/translations/zh-CN/data/reusables/enterprise-accounts/settings-tab.md @@ -1,10 +1,11 @@ --- -ms.openlocfilehash: 2ca0b407c0a2da2784d555031fd4257384ea3839 -ms.sourcegitcommit: 5b1461b419dbef60ae9dbdf8e905a4df30fc91b7 +ms.openlocfilehash: 55d1e3fd84a0d13fabb3d1b8f6543055a897ed83 +ms.sourcegitcommit: c562c85cc75ffe1eb4e9595d8adc09ec71697ab1 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/10/2022 -ms.locfileid: "147876130" +ms.lasthandoff: 11/22/2022 +ms.locfileid: "148180113" --- 1. 在企业帐户侧边栏中,单击 {% octicon "gear" aria-label="The Settings gear" %}“设置”。 ![企业帐户侧边栏中的“设置”选项卡](/assets/images/help/business-accounts/enterprise-account-settings-tab.png) + \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/enterprise_installation/image-urls-viewable-warning.md b/translations/zh-CN/data/reusables/enterprise_installation/image-urls-viewable-warning.md index ecff795df4..d4ad4ce937 100644 --- a/translations/zh-CN/data/reusables/enterprise_installation/image-urls-viewable-warning.md +++ b/translations/zh-CN/data/reusables/enterprise_installation/image-urls-viewable-warning.md @@ -1,5 +1,5 @@ {% warning %} -**Warning:** If you add an image attachment to a pull request or issue comment, anyone can view the anonymized image URL without authentication{% ifversion ghes %}, even if the pull request is in a private repository, or if private mode is enabled. To prevent unauthorized access to the images, ensure that you restrict network access to the systems that serve the images, including {% data variables.location.product_location %}{% endif %}.{% ifversion ghae %} To prevent unauthorized access to image URLs on {% data variables.product.product_name %}, consider restricting network traffic to your enterprise. For more information, see "[Restricting network traffic to your enterprise](/admin/configuration/restricting-network-traffic-to-your-enterprise)."{% endif %} +**Warning:** If you add an image attachment to a pull request or issue comment, anyone can view the anonymized image URL without authentication{% ifversion ghes %}, even if the pull request is in a private repository, or if private mode is enabled. To prevent unauthorized access to the images, ensure that you restrict network access to the systems that serve the images, including {% data variables.location.product_location %}{% endif %}.{% ifversion ghae %} To prevent unauthorized access to image URLs on {% data variables.product.product_name %}, consider restricting network traffic to your enterprise. For more information, see "[Restricting network traffic to your enterprise with an IP allow list](/admin/configuration/configuring-your-enterprise/restricting-network-traffic-to-your-enterprise-with-an-ip-allow-list)."{% endif %} {% endwarning %} diff --git a/translations/zh-CN/data/reusables/enterprise_user_management/SAML-to-OIDC-migration-for-EMU.md b/translations/zh-CN/data/reusables/enterprise_user_management/SAML-to-OIDC-migration-for-EMU.md new file mode 100644 index 0000000000..6b3bb43700 --- /dev/null +++ b/translations/zh-CN/data/reusables/enterprise_user_management/SAML-to-OIDC-migration-for-EMU.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: 303172b12f23dc26668c3ac8a09c3b943eb64fbb +ms.sourcegitcommit: c562c85cc75ffe1eb4e9595d8adc09ec71697ab1 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/22/2022 +ms.locfileid: "148180106" +--- +如果目前使用 SAML SSO 进行身份验证,并且更希望使用 OIDC 并受益于 CAP 支持,则可以遵循迁移路径。 有关详细信息,请参阅“[从 SAML 迁移到 OIDC](/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/migrating-from-saml-to-oidc)”。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/identity-and-permissions/about-adding-ip-allow-list-entries.md b/translations/zh-CN/data/reusables/identity-and-permissions/about-adding-ip-allow-list-entries.md index eb228c7495..af9e2e65e5 100644 --- a/translations/zh-CN/data/reusables/identity-and-permissions/about-adding-ip-allow-list-entries.md +++ b/translations/zh-CN/data/reusables/identity-and-permissions/about-adding-ip-allow-list-entries.md @@ -1,11 +1,3 @@ ---- -ms.openlocfilehash: db4c80c49c4e3effe99073f29010147f3a1efc08 -ms.sourcegitcommit: f638d569cd4f0dd6d0fb967818267992c0499110 -ms.translationtype: HT -ms.contentlocale: zh-CN -ms.lasthandoff: 10/25/2022 -ms.locfileid: "148108066" ---- -可以通过添加各自包含 IP 地址或地址范围的条目来创建 IP 允许列表。{% ifversion ip-allow-list-address-check %}添加条目完成后,可以检查列表中是否有任何已启用条目允许使用特定 IP 地址。{% endif %} +You can create an IP allow list by adding entries that each contain an IP address or address range. After you finish adding entries, you can check whether a particular IP address would be allowed by any of the enabled entries in your list. -在列表限制对{% ifversion ghae %}你的企业{% else %}企业中由组织拥有的专用资产{% endif %}的访问之前,还必须启用允许的 IP 地址。 +Before the list restricts access to {% ifversion ghae %}your enterprise{% else %}private assets owned by organizations in your enterprise{% endif %}, you must also enable allowed IP addresses. diff --git a/translations/zh-CN/data/reusables/identity-and-permissions/about-editing-ip-allow-list-entries.md b/translations/zh-CN/data/reusables/identity-and-permissions/about-editing-ip-allow-list-entries.md index 84b7a21abc..f8c5490631 100644 --- a/translations/zh-CN/data/reusables/identity-and-permissions/about-editing-ip-allow-list-entries.md +++ b/translations/zh-CN/data/reusables/identity-and-permissions/about-editing-ip-allow-list-entries.md @@ -1,12 +1,3 @@ ---- -ms.openlocfilehash: 8f78a77c83ea498d8d41a0deff20903062542479 -ms.sourcegitcommit: f638d569cd4f0dd6d0fb967818267992c0499110 -ms.translationtype: HT -ms.contentlocale: zh-CN -ms.lasthandoff: 10/25/2022 -ms.locfileid: "148108064" ---- -可以在 IP 允许列表中编辑条目。 如果编辑已启用的条目,则更改会立即实施。 +You can edit an entry in your IP allow list. If you edit an enabled entry, changes are enforced immediately. -{% ifversion ip-allow-list-address-check %}编辑条目完成之后,可以检查列表中是否有任何已启用条目允许使用特定 IP 地址。 -{% endif %} +After you finish editing entries, you can check whether your allow list will permit a connection from a particular IP address after you enable the list. \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/identity-and-permissions/about-enabling-allowed-ip-addresses.md b/translations/zh-CN/data/reusables/identity-and-permissions/about-enabling-allowed-ip-addresses.md index 63f2a8d857..25129e468e 100644 --- a/translations/zh-CN/data/reusables/identity-and-permissions/about-enabling-allowed-ip-addresses.md +++ b/translations/zh-CN/data/reusables/identity-and-permissions/about-enabling-allowed-ip-addresses.md @@ -1,12 +1,3 @@ ---- -ms.openlocfilehash: 095556009ed66ca0b687734f62f21c70fd87699a -ms.sourcegitcommit: f638d569cd4f0dd6d0fb967818267992c0499110 -ms.translationtype: HT -ms.contentlocale: zh-CN -ms.lasthandoff: 10/25/2022 -ms.locfileid: "148108063" ---- -创建 IP 允许列表后,可以启用允许的 IP 地址。 启用允许的 IP 地址时,{% data variables.product.company_short %} 会立即强制实施 IP 允许列表中的任何已启用条目。 +After you create an IP allow list, you can enable allowed IP addresses. When you enable allowed IP addresses, {% data variables.product.company_short %} immediately enforces any enabled entries in your IP allow list. -{% ifversion ip-allow-list-address-check %}启用允许的 IP 地址之前,可以检查列表中是否有任何已启用条目允许使用特定 IP 地址。 有关详细信息,请参阅“[检查是否允许使用 IP 地址](#checking-if-an-ip-address-is-permitted)”。 -{% endif %} +Before you enable your IP allow list, you can check whether your allow list will permit a connection from a particular IP address. For more information, see "[Checking if an IP address is permitted](#checking-if-an-ip-address-is-permitted)." \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/identity-and-permissions/check-ip-address.md b/translations/zh-CN/data/reusables/identity-and-permissions/check-ip-address.md index 3b9cc1e550..c22edc3a7d 100644 --- a/translations/zh-CN/data/reusables/identity-and-permissions/check-ip-address.md +++ b/translations/zh-CN/data/reusables/identity-and-permissions/check-ip-address.md @@ -1,11 +1,9 @@ --- -ms.openlocfilehash: 7b848e4c3bb4a9a4578e3f1ff92f6249dd20c699 -ms.sourcegitcommit: f638d569cd4f0dd6d0fb967818267992c0499110 +ms.openlocfilehash: 18467aadad6c07acc5efc9080626cd5c1bec2a6d +ms.sourcegitcommit: c562c85cc75ffe1eb4e9595d8adc09ec71697ab1 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 10/25/2022 -ms.locfileid: "148108663" +ms.lasthandoff: 11/22/2022 +ms.locfileid: "148180003" --- -{%- ifversion ip-allow-list-address-check %} 1. (可选)检查列表中是否有任何已启用条目允许使用特定 IP 地址。 有关详细信息,请参阅“[检查是否允许使用 IP 地址](#checking-if-an-ip-address-is-permitted)”。 -{%- endif %} diff --git a/translations/zh-CN/data/reusables/identity-and-permissions/ip-allow-lists-enable.md b/translations/zh-CN/data/reusables/identity-and-permissions/ip-allow-lists-enable.md index 9b382356fa..f587d9ab82 100644 --- a/translations/zh-CN/data/reusables/identity-and-permissions/ip-allow-lists-enable.md +++ b/translations/zh-CN/data/reusables/identity-and-permissions/ip-allow-lists-enable.md @@ -1,3 +1,9 @@ -To enforce the IP allow list, you must first add IP addresses to the list, then enable the IP allow list.{% ifversion ip-allow-list-address-check %} After you complete your list, you can check whether a particular IP address would be allowed by any of the enabled entries in the list.{% endif %} - -You must add your current IP address, or a matching range, before you enable the IP allow list. +--- +ms.openlocfilehash: c42c0ef2686e4419be79cccce149d25c6ed0638c +ms.sourcegitcommit: 22d665055b1bee7a5df630385e734e3a149fc720 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 07/13/2022 +ms.locfileid: "145097395" +--- +要执行 IP 允许列表,必须先将 IP 地址添加到列表,然后启用 IP 允许列表。 您必须先添加当前 IP 地址或匹配范围,然后才能启用 IP 允许列表。 diff --git a/translations/zh-CN/data/reusables/identity-and-permissions/ip-allow-lists-githubapps-enterprise.md b/translations/zh-CN/data/reusables/identity-and-permissions/ip-allow-lists-githubapps-enterprise.md index 11328f460f..1b0ced7720 100644 --- a/translations/zh-CN/data/reusables/identity-and-permissions/ip-allow-lists-githubapps-enterprise.md +++ b/translations/zh-CN/data/reusables/identity-and-permissions/ip-allow-lists-githubapps-enterprise.md @@ -1,22 +1,16 @@ ---- -ms.openlocfilehash: 130c705dad9367dbecb144ac281e8e58fa6d6cb7 -ms.sourcegitcommit: 5b1461b419dbef60ae9dbdf8e905a4df30fc91b7 -ms.translationtype: HT -ms.contentlocale: zh-CN -ms.lasthandoff: 09/10/2022 -ms.locfileid: "147880370" ---- -如果您使用允许列表,还可以选择将为企业中安装的 {% data variables.product.prodname_github_apps %} 配置的任何 IP 地址自动添加到允许列表中。 +If you're using an allow list, you can also choose to automatically add to your allow list any IP addresses configured for {% data variables.product.prodname_github_apps %} that are installed in your enterprise. {% data reusables.identity-and-permissions.ip-allow-lists-address-inheritance %} {% data reusables.apps.ip-allow-list-only-apps %} -有关如何为已创建的 {% data variables.product.prodname_github_app %} 创建允许列表的详细信息,请参阅“[管理 GitHub 应用的允许 IP 地址](/developers/apps/building-github-apps/managing-allowed-ip-addresses-for-a-github-app)”。 +For more information about how to create an allow list for a {% data variables.product.prodname_github_app %} you have created, see "[Managing allowed IP addresses for a GitHub App](/developers/apps/building-github-apps/managing-allowed-ip-addresses-for-a-github-app)." -为 {% data variables.product.prodname_github_apps %} 启用自动添加 IP 地址: +To enable automatic addition of IP addresses for {% data variables.product.prodname_github_apps %}: -{% data reusables.enterprise-accounts.access-enterprise %} {% data reusables.enterprise-accounts.settings-tab %} {% data reusables.enterprise-accounts.security-tab %} -1. 在“IP 允许列表”下,选择“为已安装的 GitHub 应用启用 IP 允许列表配置”。 - ![允许 GitHub 应用 IP 地址的复选框](/assets/images/help/security/enable-ip-allowlist-githubapps-checkbox.png) -1. 单击“保存” 。 +{% data reusables.enterprise-accounts.access-enterprise %} +{% data reusables.enterprise-accounts.settings-tab %} +{% data reusables.enterprise-accounts.security-tab %} +1. Select **Enable IP allow list configuration for installed GitHub Apps**. If you are using {% data variables.product.prodname_emus %} with OIDC, first select **GitHub** as your IP allow list configuration, then select **Enable IP allow list configuration for installed GitHub Apps**. + ![Checkbox to allow GitHub App IP addresses](/assets/images/help/security/enable-ip-allowlist-githubapps-checkbox.png) +1. Click **Save**. diff --git a/translations/zh-CN/data/reusables/projects/projects-filters.md b/translations/zh-CN/data/reusables/projects/projects-filters.md index 0fa8f3b743..dde3b0bf97 100644 --- a/translations/zh-CN/data/reusables/projects/projects-filters.md +++ b/translations/zh-CN/data/reusables/projects/projects-filters.md @@ -1,10 +1,18 @@ -- To filter for any match of multiple values (an OR query), separate the values with a comma. For example `label:"good first issue",bug` will list all issues labelled `good first issue` or `bug`. -- To filter for the absence of a specific value, place `-` before your filter. For example, `-label:"bug"` will only show items that do not have the label `bug`. -- To filter for the absence of all values, enter `no:` followed by the field name. For example, `no:assignee` will only show items that do not have an assignee. -- To filter by state, enter `is:`. For example, `is: issue` or `is:open`. -- Separate multiple filters with a space. For example, `status:"In progress" -label:"bug" no:assignee` will show only items that have a status of `In progress`, do not have the label `bug`, and do not have an assignee. -- To filter for the previous, current, or next iteration of an iteration field, use `@previous`, `@current`, or `@next`. For example, `iteration:@current`. -- To filter for items assigned to the viewer, use `@me`. For example, `assignee:@me`. Anyone using this view will see items assigned to themselves. -- To filter by when an item was last updated, use `last-updated:` followed by the number of days. This filter only supports `{number}days` (or `1day` for a single day) as a unit. For example, `last-updated:7days` will only show items that were last updated 7 or more days ago. -- To filter date and number fields, use `>`, `>=`, `<`, `<=`, and `..` range queries. For example: `target:2022-03-01..2022-03-15`. For more information, see "[Understanding the search syntax](/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax)." {% ifversion projects-v2-tasklists %} -- To filter for issues tracked by a specified issue, use `tracked-by:"/#"` and replace `` with the repository owner, `` with the repository name, and `` with the issue number. {% endif %} +--- +ms.openlocfilehash: 9106c4a2e538e62d23cd0aa2e417758376f6ffcd +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148158851" +--- +- 若要筛选多个值的任何匹配项(OR 查询),请用逗号分隔这些值。 例如 `label:"good first issue",bug` 将列出所有标记为 `good first issue` 或 `bug` 的问题。 +- 要筛选缺少特定值的字段,请在筛选器之前加上 `-`。 例如,`-label:"bug"` 将仅显示没有标签 `bug` 的项。 +- 要筛选缺少所有值的字段,请输入 `no:`,后跟字段名称。 例如,`no:assignee` 将仅显示没有受理人的项。 +- 若要按状态进行筛选,请输入 `is:`。 例如,`is: issue` 或 `is:open`。 +- 多个过滤条件之间用逗号分隔。 例如,`status:"In progress" -label:"bug" no:assignee` 将仅显示状态为 `In progress`、没有标签 `bug` 且没有受理人的项。 +- 要筛选迭代字段的上一个、当前或下一个迭代,请使用 `@previous`、`@current` 或 `@next`。 例如,`iteration:@current`。 +- 若要筛选分配给查看器的项,请使用 `@me`。 例如,`assignee:@me`。 使用此视图的任何人都会看到分配给自己的项。 +- 若要按项的上次更新时间进行筛选,请使用 `last-updated:`,后跟天数。 此筛选器仅支持 `{number}days`(一天用 `1day`)为一个单位。 例如,`last-updated:7days` 将仅显示上次更新在 7 天或 7 天前的项。 +- 若要筛选日期和数字字段,请使用 `>`、`>=`、`<`、`<=` 和 `..` 范围查询。 例如:`target:2022-03-01..2022-03-15`。 有关详细信息,请参阅“[了解搜索语法](/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax)”。 {% ifversion projects-v2-tasklists %} +- 若要筛选指定问题跟踪的问题,请使用 `tracked-by:"/#"` 并将 `` 替换为存储库所有者、将 `` 替换为存储库名称,将 `` 替换为问题编号。 {% endif %} diff --git a/translations/zh-CN/data/reusables/projects/tasklists-release-stage.md b/translations/zh-CN/data/reusables/projects/tasklists-release-stage.md new file mode 100644 index 0000000000..a19738a629 --- /dev/null +++ b/translations/zh-CN/data/reusables/projects/tasklists-release-stage.md @@ -0,0 +1,13 @@ +--- +ms.openlocfilehash: 989d63ee95229407cd3c3b05f5cfb41bd9038aee +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159450" +--- +{% note %} + +**注意:** 项目的任务列表以及跟踪和跟踪依据字段目前为专用 beta 版,可能会发生更改。 如果有兴趣尝试任务列表并使用新字段,可以加入[等待列表](https://aka.ms/tasklist-roadmap-signup)。 + +{% endnote %} \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/repositories/sidebar-advisories.md b/translations/zh-CN/data/reusables/repositories/sidebar-advisories.md index 2a583311b1..fbef426382 100644 --- a/translations/zh-CN/data/reusables/repositories/sidebar-advisories.md +++ b/translations/zh-CN/data/reusables/repositories/sidebar-advisories.md @@ -1,10 +1,10 @@ --- -ms.openlocfilehash: 309963c78d20d0ae2bb067deed484e5eb45dc43c -ms.sourcegitcommit: 5b1461b419dbef60ae9dbdf8e905a4df30fc91b7 +ms.openlocfilehash: b598a0f5e8e2d131e5381f0f867518de344084c9 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/10/2022 -ms.locfileid: "147876191" +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159453" --- -1. 在左侧边栏中,单击“安全通告”。 +1. 在左侧边栏的“报告”下,单击“通告”。 ![“安全通告”选项卡](/assets/images/help/security/advisories-tab.png) diff --git a/translations/zh-CN/data/reusables/repositories/sidebar-security.md b/translations/zh-CN/data/reusables/repositories/sidebar-security.md index dc98bfece0..1c67e51149 100644 --- a/translations/zh-CN/data/reusables/repositories/sidebar-security.md +++ b/translations/zh-CN/data/reusables/repositories/sidebar-security.md @@ -1,10 +1,10 @@ --- -ms.openlocfilehash: 8a30be469d4a74efc97849e83e825f619c585036 -ms.sourcegitcommit: fb047f9450b41b24afc43d9512a5db2a2b750a2a +ms.openlocfilehash: 88f9918556730cd1d87c09c72a032d15a149d220 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/11/2022 -ms.locfileid: "145084412" +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159447" --- -1. 在存储库名称下,单击“{% octicon "shield" aria-label="The shield symbol" %}安全性”。 +1. 在存储库名称下,单击“{% octicon "shield" aria-label="The shield symbol" %} 安全性”。 ![“安全”选项卡](/assets/images/help/repository/security-tab.png) diff --git a/translations/zh-CN/data/reusables/saml/assert-the-administrator-attribute.md b/translations/zh-CN/data/reusables/saml/assert-the-administrator-attribute.md index 349b582cfc..03c82f3eef 100644 --- a/translations/zh-CN/data/reusables/saml/assert-the-administrator-attribute.md +++ b/translations/zh-CN/data/reusables/saml/assert-the-administrator-attribute.md @@ -1,9 +1,9 @@ --- -ms.openlocfilehash: bb28859183eee48b1c16f8e309ec2d3f839d2e4e -ms.sourcegitcommit: fb047f9450b41b24afc43d9512a5db2a2b750a2a +ms.openlocfilehash: e26318e1b0d86ee5ec0c486ccaba4f7dbb8e2ed9 +ms.sourcegitcommit: ced661bdffebd0f96f6f76db109fbe31983448ba ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/11/2022 -ms.locfileid: "145129612" +ms.lasthandoff: 11/16/2022 +ms.locfileid: "148167069" --- -要使某人成为企业所有者,您必须在 IdP 中委派所有权权限。 在 IdP 上的用户帐户的 SAML 断言中包含 `administrator` 属性,其值为 `true`。 有关企业所有者的详细信息,请参阅“[企业中的角色](/admin/user-management/managing-users-in-your-enterprise/roles-in-an-enterprise)”。 +要使某人成为企业所有者,必须在 IdP 中委派访问权限。 如果使用 Azure AD 和 SCIM,请为用户分配企业所有者角色。 对于其他 IdP,请在 IdP 上的用户帐户的 SAML 断言中包含 `administrator` 属性,其值为 `true`。 有关企业所有者的详细信息,请参阅“[企业中的角色](/admin/user-management/managing-users-in-your-enterprise/roles-in-an-enterprise)”。 有关使用 Azure AD 进行身份验证和预配的详细信息,请参阅“[使用 Azure AD 为企业配置身份验证和预配](/admin/identity-and-access-management/using-saml-for-enterprise-iam/configuring-authentication-and-provisioning-for-your-enterprise-using-azure-ad)”。 diff --git a/translations/zh-CN/data/reusables/search/classic-search-code-search-note.md b/translations/zh-CN/data/reusables/search/classic-search-code-search-note.md new file mode 100644 index 0000000000..962ee6e467 --- /dev/null +++ b/translations/zh-CN/data/reusables/search/classic-search-code-search-note.md @@ -0,0 +1,11 @@ +--- +ms.openlocfilehash: 838274ec284192127269b9f56d68452cf2962133 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159408" +--- +本文面向经典 GitHub 搜索体验。 如果你正在使用新的代码搜索和代码视图 beta 版本并启用了新功能,则搜索代码的语法和 GitHub.com 搜索界面将有所不同。 但是,非代码搜索类型的搜索语法将保持不变。 + +若要了解当前处于有限公共 beta 版本的新代码搜索和代码视图,请参阅“[关于 GitHub 代码搜索(beta 版本)](/search-github/github-code-search/about-github-code-search)”。 若要试用新的代码搜索和代码视图 beta 版本,请加入[等待列表](https://github.com/features/code-search-code-view/signup)。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/search/code-search-code-view-beta-note.md b/translations/zh-CN/data/reusables/search/code-search-code-view-beta-note.md new file mode 100644 index 0000000000..6cf495423c --- /dev/null +++ b/translations/zh-CN/data/reusables/search/code-search-code-view-beta-note.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: 92a49c10ee87f1b8b076946d8b638144d7f24c5f +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159464" +--- +新的代码搜索和代码视图为有限公共 beta 版。 若要加入访问的等待列表,请访问 https://github.com/features/code-search-code-view/signup 。 diff --git a/translations/zh-CN/data/reusables/search/code-search-link.md b/translations/zh-CN/data/reusables/search/code-search-link.md new file mode 100644 index 0000000000..447ee28d06 --- /dev/null +++ b/translations/zh-CN/data/reusables/search/code-search-link.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: 47117b97072b09f605c68d17be3a5fc350053862 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159490" +--- +有关新代码搜索的详细信息,请参阅“[关于 GitHub 代码搜索(beta 版本)](/search-github/github-code-search/about-github-code-search)”。 diff --git a/translations/zh-CN/data/reusables/search/code-view-link.md b/translations/zh-CN/data/reusables/search/code-view-link.md new file mode 100644 index 0000000000..d95be5e4ce --- /dev/null +++ b/translations/zh-CN/data/reusables/search/code-view-link.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: fc1fa9b6a29ae3e58d822d9379ba004a0196b054 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159492" +--- +有关新代码视图的详细信息,请参阅“[使用新代码视图 (beta) 导航文件](/repositories/working-with-files/managing-files/navigating-files-with-the-new-code-view)”。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/search/enabling-and-disabling-code-search-and-view-beta.md b/translations/zh-CN/data/reusables/search/enabling-and-disabling-code-search-and-view-beta.md new file mode 100644 index 0000000000..73d4dbce44 --- /dev/null +++ b/translations/zh-CN/data/reusables/search/enabling-and-disabling-code-search-and-view-beta.md @@ -0,0 +1,14 @@ +--- +ms.openlocfilehash: 56c01942ad1ac3496b9875a039a091676e3fc51e +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159493" +--- +当等待列表中的你被接受加入 beta 版时,你将收到一封电子邮件。 获得访问权限后,将在你的帐户上自动启用新的代码搜索和代码视图 beta 版。 + +可以随时在 {% data variables.product.prodname_dotcom_the_website %} 上禁用或启用 beta 版。 请注意,此设置适用于代码搜索和代码视图。 + +{% data reusables.feature-preview.feature-preview-setting %} +1. 在“新代码搜索和代码视图(Beta)”右侧,单击“启用”或“禁用” 。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/search/non-code-search-explanation.md b/translations/zh-CN/data/reusables/search/non-code-search-explanation.md new file mode 100644 index 0000000000..fe9800a448 --- /dev/null +++ b/translations/zh-CN/data/reusables/search/non-code-search-explanation.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: c1ebccb91c4ab8257429c582ab6c42e6583f823b +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159505" +--- +请注意,用于搜索非代码内容(如问题、用户和讨论)的语法和限定符的工作原理与以前相同。 有关非代码搜索的详细信息,请参阅[关于在 GitHub 上搜索](/search-github/getting-started-with-searching-on-github/about-searching-on-github)和[在 GitHub 上搜索](/search-github/searching-on-github)。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/security-advisory/private-vulnerability-reporting-beta.md b/translations/zh-CN/data/reusables/security-advisory/private-vulnerability-reporting-beta.md new file mode 100644 index 0000000000..3b7e6bbd12 --- /dev/null +++ b/translations/zh-CN/data/reusables/security-advisory/private-vulnerability-reporting-beta.md @@ -0,0 +1,13 @@ +--- +ms.openlocfilehash: 3a6ce7caed12668a49728186aa2d3911d4f90668 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159409" +--- +{% note %} + +注意:漏洞的专用报告目前处于 beta 阶段,可能会发生更改。 + +{% endnote %} \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/security-advisory/private-vulnerability-reporting-enable.md b/translations/zh-CN/data/reusables/security-advisory/private-vulnerability-reporting-enable.md new file mode 100644 index 0000000000..c775cb2a47 --- /dev/null +++ b/translations/zh-CN/data/reusables/security-advisory/private-vulnerability-reporting-enable.md @@ -0,0 +1,10 @@ +--- +ms.openlocfilehash: e4d1f38bc3b4f5c0ac9efbe78084116696d2ee34 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159412" +--- +公共存储库的所有者和管理员可以对其存储库启用专用漏洞报告。 有关详细信息,请参阅“[为存储库配置专用漏洞报告](/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository)”。 + diff --git a/translations/zh-CN/data/reusables/security-advisory/private-vulnerability-reporting-overview.md b/translations/zh-CN/data/reusables/security-advisory/private-vulnerability-reporting-overview.md new file mode 100644 index 0000000000..e95af6069e --- /dev/null +++ b/translations/zh-CN/data/reusables/security-advisory/private-vulnerability-reporting-overview.md @@ -0,0 +1,11 @@ +--- +ms.openlocfilehash: 76133fe9416c92282de821d12e88432cdc1b5452 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159418" +--- +通过专用漏洞报告,安全研究人员可以轻松地使用简单的表单直接向你报告漏洞。 + +当安全研究人员私下报告漏洞时,你会收到通知并且可以选择接受报告、提出更多问题或拒绝报告。 如果接受报告,则可以与安全研究人员私下协作修复漏洞。 \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/security-advisory/security-researcher-cannot-create-advisory.md b/translations/zh-CN/data/reusables/security-advisory/security-researcher-cannot-create-advisory.md index 5e6af74189..d7e9054344 100644 --- a/translations/zh-CN/data/reusables/security-advisory/security-researcher-cannot-create-advisory.md +++ b/translations/zh-CN/data/reusables/security-advisory/security-researcher-cannot-create-advisory.md @@ -1,13 +1,13 @@ --- -ms.openlocfilehash: 842c9e724fedf0f6758935c2081916f3b7cfe35d -ms.sourcegitcommit: 47bd0e48c7dba1dde49baff60bc1eddc91ab10c5 +ms.openlocfilehash: 7d82a865735b8fa7966b15d72c0710224ceead3f +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 ms.translationtype: HT ms.contentlocale: zh-CN -ms.lasthandoff: 09/05/2022 -ms.locfileid: "145130038" +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159513" --- {% note %} -注意:如果你是安全研究人员,应直接联系维护人员,要求他们创建安全通告,或在你不管理的存储库中代表你发布 CVE。 +注意:如果你是安全研究人员,应直接联系维护人员,要求他们创建安全通告,或在你不管理的存储库中代表你发布 CVE。 但是,如果为存储库启用了私人漏洞报告,则可以自行私下报告漏洞。 有关详细信息,请参阅“[私下报告安全漏洞](/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)”。 -{% endnote %} +{% endnote %} \ No newline at end of file diff --git a/translations/zh-CN/data/reusables/security-overview/beta-org-risk-coverage.md b/translations/zh-CN/data/reusables/security-overview/beta-org-risk-coverage.md new file mode 100644 index 0000000000..a9c792c8e1 --- /dev/null +++ b/translations/zh-CN/data/reusables/security-overview/beta-org-risk-coverage.md @@ -0,0 +1,13 @@ +--- +ms.openlocfilehash: a6449876cc0f409f9c5d6ea4f72268299fea9818 +ms.sourcegitcommit: e8c012864f13f9146e53fcb0699e2928c949ffa8 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/09/2022 +ms.locfileid: "148159446" +--- +{% ifversion security-overview-org-risk-coverage %} {% note %} + +注意:“安全风险”和“安全范围”视图目前为 beta 版本,可能会随时发生更改。 + +{% endnote %} {% endif %} diff --git a/translations/zh-CN/data/reusables/user-settings/sessions.md b/translations/zh-CN/data/reusables/user-settings/sessions.md new file mode 100644 index 0000000000..a5fd47a2bd --- /dev/null +++ b/translations/zh-CN/data/reusables/user-settings/sessions.md @@ -0,0 +1,9 @@ +--- +ms.openlocfilehash: bd35cf7047bb22a5c41ba794a5fb02317f9f705f +ms.sourcegitcommit: b2e5d14036a700b781e91158a552f8c0b1f04839 +ms.translationtype: HT +ms.contentlocale: zh-CN +ms.lasthandoff: 11/15/2022 +ms.locfileid: "148165576" +--- +1. 在边栏的“访问”部分中,单击“{% octicon "broadcast" aria-label="The broadcast icon" %} 会话”。 \ No newline at end of file
运行器映像YAML 工作流标签说明Runner imageYAML workflow labelNotes
-windows-latestwindows-2022 +windows-latest or windows-2022 -windows-latest 标签当前使用 Windows Server 2022 运行器映像。 +The windows-latest label currently uses the Windows Server 2022 runner image.
-ubuntu-latestubuntu-20.04 +ubuntu-latest or ubuntu-20.04 +The ubuntu-latest label is currently transitioning to the Ubuntu 22.04 runner image. During the transition, the label might refer to the runner image for either Ubuntu 20.04 or 22.04. For more information, see this {% data variables.product.prodname_dotcom %} blog post. +
-Ubuntu 18.04 [已弃用] +Ubuntu 18.04 [deprecated] ubuntu-18.04 -迁移到 ubuntu-20.04ubuntu-22.04。 有关详细信息,请参阅此 GitHub 博客文章。 +Migrate to ubuntu-20.04 or ubuntu-22.04. For more information, see this GitHub blog post.
-macos-latestmacos-11 +macos-latest or macos-11 -macos-latest 标签当前使用 macOS 11 运行器映像。 +The macos-latest label is currently transitioning to the macOS Monterey 12 runner image. During the transition, the label might refer to the runner image for either macOS 11 or 12. For more information, see this {% data variables.product.prodname_dotcom %} blog post.
-macOS Catalina 10.15 [已弃用] +macOS Catalina 10.15 [deprecated] macos-10.15 -迁移到 macOS-11macOS-12。 有关详细信息,请参阅此 GitHub 博客文章。 +Migrate to macOS-11 or macOS-12. For more information, see this GitHub blog post.