diff --git a/assets/images/help/codespaces/gpg-vscode-setting.png b/assets/images/help/codespaces/gpg-vscode-setting.png new file mode 100644 index 0000000000..eaffc8d9f4 Binary files /dev/null and b/assets/images/help/codespaces/gpg-vscode-setting.png differ diff --git a/assets/images/help/codespaces/vscode-settings.png b/assets/images/help/codespaces/vscode-settings.png new file mode 100644 index 0000000000..8d695124fb Binary files /dev/null and b/assets/images/help/codespaces/vscode-settings.png differ diff --git a/content/codespaces/developing-in-codespaces/using-github-codespaces-for-pull-requests.md b/content/codespaces/developing-in-codespaces/using-github-codespaces-for-pull-requests.md index 61c889540a..0f80ef0d71 100644 --- a/content/codespaces/developing-in-codespaces/using-github-codespaces-for-pull-requests.md +++ b/content/codespaces/developing-in-codespaces/using-github-codespaces-for-pull-requests.md @@ -18,7 +18,7 @@ redirect_from: {% data variables.product.prodname_github_codespaces %} provides you with many of the capabilities you might need to work with pull requests: -- [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. +- [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). diff --git a/content/codespaces/the-githubdev-web-based-editor.md b/content/codespaces/the-githubdev-web-based-editor.md index 18e53043d4..4f225d6a7d 100644 --- a/content/codespaces/the-githubdev-web-based-editor.md +++ b/content/codespaces/the-githubdev-web-based-editor.md @@ -71,7 +71,7 @@ To continue your work in a codespace, click **Continue Working on…** and selec ## Using source control -When you use {% data variables.codespaces.serverless %}, all actions are managed through the Source Control View, which is located in the Activity Bar on the left hand side. For more information on the Source Control View, see "[Version Control](https://code.visualstudio.com/docs/editor/versioncontrol)" in the {% data variables.product.prodname_vscode_shortname %} documentation. +When you use {% data variables.codespaces.serverless %}, all actions are managed through the "Source Control" view, which is located in the Activity Bar on the left hand side. For more information on the "Source Control" view, see "[Version Control](https://code.visualstudio.com/docs/editor/versioncontrol)" in the {% data variables.product.prodname_vscode_shortname %} documentation. Because {% data variables.codespaces.serverless %} uses the GitHub Repositories extension to power its functionality, you can switch branches without needing to stash changes. For more information, see "[GitHub Repositories](https://code.visualstudio.com/docs/editor/github#_github-repositories-extension)" in the {% data variables.product.prodname_vscode_shortname %} documentation. diff --git a/content/codespaces/troubleshooting/troubleshooting-gpg-verification-for-github-codespaces.md b/content/codespaces/troubleshooting/troubleshooting-gpg-verification-for-github-codespaces.md index 970de35e81..162fae3e18 100644 --- a/content/codespaces/troubleshooting/troubleshooting-gpg-verification-for-github-codespaces.md +++ b/content/codespaces/troubleshooting/troubleshooting-gpg-verification-for-github-codespaces.md @@ -14,18 +14,13 @@ If you enable GPG verification, {% data variables.product.prodname_github_codesp {% data reusables.codespaces.gpg-in-active-codespaces %} -If {% data variables.product.prodname_github_codespaces %} fails to sign a commit, you may see an error like the following. +If {% data variables.product.prodname_github_codespaces %} fails to sign a commit, you may see the error message `gpg failed to sign the data` in the command line or in a {% data variables.product.prodname_vscode %} pop-up window. -```Shell -$ git commit -m 'Initial commit' -error: gpg failed to sign the data -fatal: failed to write commit object -``` +The following sections of this article provide troubleshooting advice for common causes of this error. -You may encounter this error if: - -- You have disabled GPG verification, and are trying to make a regular, unsigned commit in an existing codespace. -- You have enabled GPG verification, but have overridden the Git configuration required for {% data variables.product.prodname_github_codespaces %} to sign your commits, for example by linking {% data variables.product.prodname_github_codespaces %} with a dotfiles repository that contains Git configuration files. +- If GPG verification has previously been enabled in your settings for {% data variables.product.prodname_github_codespaces %}, and you have recently disabled GPG verification or removed a repository from your list of trusted repositories, Git may still be trying to sign your commits. For more information, see "[Errors after disabling GPG verification](#errors-after-disabling-gpg-verification)." +- If GPG verification is enabled for the codespace, you may have overridden the Git configuration required to sign your commits. For more information, see "[Errors caused by conflicting Git configuration](#errors-caused-by-conflicting-git-configuration)." +- If GPG verification is disabled for the codespace, and you're encountering the error when trying to commit from the "Source Control" view in {% data variables.product.prodname_vscode_shortname %}, this may be because of your {% data variables.product.prodname_vscode_shortname %} settings. For more information, see "[Errors in the {% data variables.product.prodname_vscode_shortname %} "Source Control" view](#errors-in-the-vs-code-source-control-view)." ## Errors after disabling GPG verification @@ -41,7 +36,7 @@ git config --unset commit.gpgsign To check that the value has been correctly removed from your configuration, you can enter `git config --list`. You should not see a value for `commit.gpgsign` in the list. -## Errors caused by conflicting configuration +## Errors caused by conflicting Git configuration To automatically sign your commits, {% data variables.product.prodname_github_codespaces %} sets certain Git configuration values in your codespace. If you override the values set by {% data variables.product.prodname_github_codespaces %}, you may be unable to sign your commits. @@ -108,6 +103,23 @@ if [ -z "$CODESPACES" ]; then fi ``` +## Errors in the {% data variables.product.prodname_vscode_shortname %} "Source Control" view + +If GPG verification is disabled in your settings for {% data variables.product.prodname_github_codespaces %}, or the repository you created the codespace from isn't in your list of trusted repositories, then Git should not attempt to sign your commits. If you encounter a signing error when trying to commit from the "Source Control" view in {% data variables.product.prodname_vscode_shortname %}, you should check the {% data variables.product.prodname_vscode_shortname %} settings in your codespace. + +1. In the lower-left corner of the window, select **{% octicon "gear" aria-label="Manage" %}**, then click **Settings**. + + ![Screenshot of a section of the {% data variables.product.prodname_vscode_shortname %} web client. A gear icon and the "Settings" option in a menu are both highlighted with an orange outline.](/assets/images/help/codespaces/vscode-settings.png) + +1. On the "User" tab, in the search bar, search for "gpg". +1. Verify that the "Enables commit signing with GPG or X.509" setting is deselected. + + ![Screenshot of the "User" settings tab. A deselected checkbox, labeled "Enables commit signing with GPG or X.509," is highlighted with an orange outline.](/assets/images/help/codespaces/gpg-vscode-setting.png) + +If you find this setting is enabled, you should either deselect the checkbox to stop {% data variables.product.prodname_vscode_shortname %} trying to sign your commits, or you should enable GPG verification for the repository you're working in so your commits can be signed successfully. + +If you change your {% data variables.product.prodname_vscode_shortname %} settings, you must ensure Settings Sync is enabled if you want to share your changes with other codespaces you create. You should only turn on Settings Sync in a codespace created from a repository you trust. For more information, see "[AUTOTITLE](/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account#settings-sync)." + ## Further reading - "[AUTOTITLE](/authentication/managing-commit-signature-verification/about-commit-signature-verification)" diff --git a/contributing/codespace.md b/contributing/codespace.md index f468d80d01..993e0ed6b3 100644 --- a/contributing/codespace.md +++ b/contributing/codespace.md @@ -23,7 +23,7 @@ The steps described below assume you have GitHub Codespaces set up to edit files In most cases, the path to the file, below the `content` directory, matches the path in URL, minus the `.md` file name extension. For example, the source for the article https://docs.github.com/en/**codespaces/getting-started/quickstart** is the markdown file content/**codespaces/getting-started/quickstart**.md. 1. Edit the markdown file as required. 1. Save your changes. -1. Commit and push your changes, either using the Source Control pane, or using Git commands from the Terminal. For more information, see "[About Git](https://docs.github.com/en/get-started/using-git/about-git)." +1. Commit and push your changes, either using the "Source Control" view, or using Git commands from the Terminal. For more information, see "[About Git](https://docs.github.com/en/get-started/using-git/about-git)." 1. Go to the **Pull requests** tab of the `github/docs` repository: https://github.com/github/docs/pulls 1. Click **New pull request**. 1. If you're an open source contributor: click **compare across forks** and choose the forked repository you created, and your working branch.
diff --git a/data/reusables/codespaces/publishing-template-codespaces.md b/data/reusables/codespaces/publishing-template-codespaces.md index 18c8cfe19c..0bee28be2b 100644 --- a/data/reusables/codespaces/publishing-template-codespaces.md +++ b/data/reusables/codespaces/publishing-template-codespaces.md @@ -7,7 +7,7 @@ If you're working in a codespace, you can publish it from the {% data variables. {% note %} - **Note:** If you start from {% data variables.product.company_short %}'s blank template, you will not see a list of changes unless you have already initialized your directory as a Git repository. To publish codespaces created from the blank template, click **Publish to {% data variables.product.company_short %}** in the Source Control view, then skip to step 5. + **Note:** If you start from {% data variables.product.company_short %}'s blank template, you will not see a list of changes unless you have already initialized your directory as a Git repository. To publish codespaces created from the blank template, click **Publish to {% data variables.product.company_short %}** in the "Source Control" view, then skip to step 5. {% endnote %} 1. To commit your staged changes, type a commit message describing the change you've made, then click **Commit**.