title | shortTitle | intro | versions | type | topics | redirect_from | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Using GitHub Codespaces for pull requests |
Pull requests |
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. |
|
how_to |
|
|
Using a codespace to work on a pull request gives you all the benefits of {% data variables.product.prodname_github_codespaces %}. For more information, see AUTOTITLE.
{% 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 - 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.github %}. If the repository uses a pull request template, you'll be able to use this within the "Source Control" view.
- Open a pull request – 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 - 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.
{% data reusables.repositories.sidebar-pr %}
-
In the list of pull requests, click the pull request you'd like to open in {% data variables.product.prodname_codespaces %}.
-
On the right-hand side of your screen, click {% octicon "code" aria-hidden="true" %} Code.
-
In the {% data variables.product.prodname_codespaces %} tab, click {% octicon "plus" aria-label="Create a codespace on BRANCH" %}.
A codespace is created for the pull request branch and is opened in your default editor for {% data variables.product.prodname_github_codespaces %}.
-
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 in {% data variables.product.prodname_codespaces %} previously in this article.
-
In the Activity Bar, click the Git pull request icon to display the "{% data variables.product.prodname_dotcom %} Pull Request" side bar. This icon is only displayed in the Activity Bar when you open a pull request in a codespace.
If you opened a pull request in a codespace and the pull request icon is not displayed in the Activity Bar, make sure you are signed in to {% data variables.product.prodname_dotcom %}. Click the {% data variables.product.prodname_dotcom %} icon in the Activity Bar then click Sign in.
-
To review the changes that have been made to a specific file, click the file's name in the "{% data variables.product.prodname_dotcom %} Pull Request" side bar.
This displays a diff view in the editor, with the version of the file from the base branch on the left, and the new version of the file, from the head branch of the pull request, on the right.
-
To add a review comment, click the + sign next to the line number in the file displayed on the right side of the editor.
-
Type your review comment and then click Start Review.
{% data reusables.codespaces.reviewing-a-pr %}
-
When you are finished adding review comments, you can add a summary comment for your pull request review in the "{% data variables.product.prodname_dotcom %} Pull Request" side bar. You can then click Comment and Submit, or click the dropdown arrow and select Approve and Submit or Request Changes and Submit.
For more information on reviewing a pull request, see AUTOTITLE.
Once you have received feedback on a pull request, you can open it in a codespace in your web browser, or in {% data variables.product.prodname_vscode_shortname %}, to see the review comments. From there you can respond to comments, add reactions, or dismiss the review.