Add CLI content to handul of articles (#19810)
* move workflow disable content to tool selector * add cli tab to workflow articles * seeing if this works * add reusable * update for each platform * update with flags * update with product switchers * update with end tag * add cli tab * update with cli and desktop tabs * add desktop and cli tabs * remove tip * get tests passing * last small updates * fix break * remove break maybe * update with download link reusable * update with download resuable * resolve feedback * quotes around string * flesh this out a bit more * remove reusable * update with more feedback Co-authored-by: Meg Bird <megbird@github.com>
This commit is contained in:
@@ -28,11 +28,13 @@ Temporarily disabling a workflow can be useful in many scenarios. These are a fe
|
|||||||
|
|
||||||
{% endwarning %}
|
{% endwarning %}
|
||||||
|
|
||||||
## Disabling and enabling workflows with the {% data variables.product.prodname_dotcom %} UI
|
You can also disable and enable a workflow using the REST API. For more information, see the "[Actions REST API](/rest/reference/actions#workflows)."
|
||||||
|
|
||||||
### Disabling a workflow
|
### Disabling a workflow
|
||||||
|
|
||||||
You can manually disable a workflow so that it won't execute any workflow runs. A disabled workflow is not deleted, and can be re-enabled.
|
{% include tool-switcher %}
|
||||||
|
|
||||||
|
{% webui %}
|
||||||
|
|
||||||
{% data reusables.repositories.navigate-to-repo %}
|
{% data reusables.repositories.navigate-to-repo %}
|
||||||
{% data reusables.repositories.actions-tab %}
|
{% data reusables.repositories.actions-tab %}
|
||||||
@@ -45,8 +47,28 @@ You can manually disable a workflow so that it won't execute any workflow runs.
|
|||||||
The disabled workflow is marked {% octicon "stop" aria-label="The stop icon" %} to indicate its status.
|
The disabled workflow is marked {% octicon "stop" aria-label="The stop icon" %} to indicate its status.
|
||||||

|

|
||||||
|
|
||||||
|
{% endwebui %}
|
||||||
|
|
||||||
|
{% cli %}
|
||||||
|
|
||||||
|
{% data reusables.cli.download-cli %}
|
||||||
|
|
||||||
|
{% data reusables.actions.actions-cli %}
|
||||||
|
|
||||||
|
To disable a workflow, use the `workflow disable` subcommand. Replace `workflow` with either the name, ID, or file name of the workflow you want to disable. For example, `"Link Checker"`, `1234567`, or `"link-check-test.yml"`. If you don't specify a workflow, {% data variables.product.prodname_cli %} returns an interactive menu for you to choose a workflow.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh workflow disable <em>workflow</em>
|
||||||
|
```
|
||||||
|
|
||||||
|
{% endcli %}
|
||||||
|
|
||||||
### Enabling a workflow
|
### Enabling a workflow
|
||||||
|
|
||||||
|
{% include tool-switcher %}
|
||||||
|
|
||||||
|
{% webui %}
|
||||||
|
|
||||||
You can re-enable a workflow that was previously disabled.
|
You can re-enable a workflow that was previously disabled.
|
||||||
|
|
||||||
{% data reusables.repositories.navigate-to-repo %}
|
{% data reusables.repositories.navigate-to-repo %}
|
||||||
@@ -56,22 +78,16 @@ You can re-enable a workflow that was previously disabled.
|
|||||||
1. Click **Enable workflow**.
|
1. Click **Enable workflow**.
|
||||||

|

|
||||||
|
|
||||||
## Disabling and enabling workflows with {% data variables.product.prodname_cli %}
|
{% endwebui %}
|
||||||
|
|
||||||
|
{% cli %}
|
||||||
|
|
||||||
{% data reusables.actions.actions-cli %}
|
{% data reusables.actions.actions-cli %}
|
||||||
|
|
||||||
To disable a workflow, use the `workflow disable` subcommand. Replace `workflow` with either the name, ID, or file name of the workflow you want to disable. For example, `"Link Checker"`, `1234567`, or `"link-check-test.yml"`. If you don't specify a workflow, {% data variables.product.prodname_cli %} returns an interactive menu for you to choose a workflow.
|
|
||||||
|
|
||||||
```shell
|
|
||||||
gh workflow disable <em>workflow</em>
|
|
||||||
```
|
|
||||||
|
|
||||||
To enable a workflow, use the `workflow enable` subcommand. Replace `workflow` with either the name, ID, or file name of the workflow you want to enable. For example, `"Link Checker"`, `1234567`, or `"link-check-test.yml"`. If you don't specify a workflow, {% data variables.product.prodname_cli %} returns an interactive menu for you to choose a workflow.
|
To enable a workflow, use the `workflow enable` subcommand. Replace `workflow` with either the name, ID, or file name of the workflow you want to enable. For example, `"Link Checker"`, `1234567`, or `"link-check-test.yml"`. If you don't specify a workflow, {% data variables.product.prodname_cli %} returns an interactive menu for you to choose a workflow.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
gh workflow enable <em>workflow</em>
|
gh workflow enable <em>workflow</em>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Disabling and enabling workflows through the REST API
|
{% endcli %}
|
||||||
|
|
||||||
You can also disable and enable a workflow using the REST API. For more information, see the "[Actions REST API](/rest/reference/actions#workflows)."
|
|
||||||
|
|||||||
@@ -13,13 +13,15 @@ shortTitle: Download workflow artifacts
|
|||||||
{% data reusables.actions.enterprise-github-hosted-runners %}
|
{% data reusables.actions.enterprise-github-hosted-runners %}
|
||||||
{% data reusables.actions.ae-beta %}
|
{% data reusables.actions.ae-beta %}
|
||||||
|
|
||||||
{% ifversion fpt or ghes > 2.22 or ghae %} By default, {% data variables.product.product_name %} stores build logs and artifacts for 90 days, and you can customize this retention period, depending on the type of repository. For more information, see "[Configuring the retention period for GitHub Actions artifacts and logs in your repository](/github/administering-a-repository/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-repository)."{% endif %}
|
{% ifversion fpt or ghes > 2.22 or ghae %} By default, {% data variables.product.product_name %} stores build logs and artifacts for 90 days, and you can customize this retention period, depending on the type of repository. For more information, see "[Configuring the retention period for GitHub Actions artifacts and logs in your repository](/github/administering-a-repository/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-repository)."{% endif %}
|
||||||
{% ifversion ghes = 2.22 %} {% data variables.product.product_name %} stores full build logs and artifacts for 90 days.{% endif %}
|
{% ifversion ghes = 2.22 %} {% data variables.product.product_name %} stores full build logs and artifacts for 90 days.{% endif %}
|
||||||
|
|
||||||
## Download artifacts with the {% data variables.product.prodname_dotcom %} UI
|
|
||||||
|
|
||||||
{% data reusables.repositories.permissions-statement-read %}
|
{% data reusables.repositories.permissions-statement-read %}
|
||||||
|
|
||||||
|
{% include tool-switcher %}
|
||||||
|
|
||||||
|
{% webui %}
|
||||||
|
|
||||||
{% data reusables.repositories.navigate-to-repo %}
|
{% data reusables.repositories.navigate-to-repo %}
|
||||||
{% data reusables.repositories.actions-tab %}
|
{% data reusables.repositories.actions-tab %}
|
||||||
{% data reusables.repositories.navigate-to-workflow %}
|
{% data reusables.repositories.navigate-to-workflow %}
|
||||||
@@ -31,7 +33,11 @@ shortTitle: Download workflow artifacts
|
|||||||

|

|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
## Download artifacts with {% data variables.product.prodname_cli %}
|
{% endwebui %}
|
||||||
|
|
||||||
|
{% cli %}
|
||||||
|
|
||||||
|
{% data reusables.cli.download-cli %}
|
||||||
|
|
||||||
{% data reusables.actions.actions-cli %}
|
{% data reusables.actions.actions-cli %}
|
||||||
|
|
||||||
@@ -60,3 +66,5 @@ To download specific artifacts across all runs in a repository, use the `run dow
|
|||||||
```shell
|
```shell
|
||||||
gh run download -n <em>artifact-name-1</em> -n <em>artifact-name-2</em>
|
gh run download -n <em>artifact-name-1</em> -n <em>artifact-name-2</em>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% endcli %}
|
||||||
|
|||||||
@@ -15,14 +15,16 @@ shortTitle: Manually run a workflow
|
|||||||
|
|
||||||
## Configuring a workflow to run manually
|
## Configuring a workflow to run manually
|
||||||
|
|
||||||
To run a workflow manually, the workflow must be configured to run on the `workflow_dispatch` event. For more information about configuring the `workflow_dispatch` event, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)".
|
To run a workflow manually, the workflow must be configured to run on the `workflow_dispatch` event. To trigger the `workflow_dispatch` event, your workflow must be in the default branch. For more information about configuring the `workflow_dispatch` event, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)".
|
||||||
|
|
||||||
## Running a workflow on {% data variables.product.prodname_dotcom %}
|
|
||||||
|
|
||||||
To trigger the `workflow_dispatch` event on {% data variables.product.prodname_dotcom %}, your workflow must be in the default branch. Follow these steps to manually trigger a workflow run.
|
|
||||||
|
|
||||||
{% data reusables.repositories.permissions-statement-write %}
|
{% data reusables.repositories.permissions-statement-write %}
|
||||||
|
|
||||||
|
### Running a workflow
|
||||||
|
|
||||||
|
{% include tool-switcher %}
|
||||||
|
|
||||||
|
{% webui %}
|
||||||
|
|
||||||
{% data reusables.repositories.navigate-to-repo %}
|
{% data reusables.repositories.navigate-to-repo %}
|
||||||
{% data reusables.repositories.actions-tab %}
|
{% data reusables.repositories.actions-tab %}
|
||||||
1. In the left sidebar, click the workflow you want to run.
|
1. In the left sidebar, click the workflow you want to run.
|
||||||
@@ -32,7 +34,11 @@ To trigger the `workflow_dispatch` event on {% data variables.product.prodname_d
|
|||||||
1. Select the branch where the workflow will run and type the input parameters used by the workflow. Click **Run workflow**.
|
1. Select the branch where the workflow will run and type the input parameters used by the workflow. Click **Run workflow**.
|
||||||

|

|
||||||
|
|
||||||
## Running a workflow using {% data variables.product.prodname_cli %}
|
{% endwebui %}
|
||||||
|
|
||||||
|
{% cli %}
|
||||||
|
|
||||||
|
{% data reusables.cli.download-cli %}
|
||||||
|
|
||||||
{% data reusables.actions.actions-cli %}
|
{% data reusables.actions.actions-cli %}
|
||||||
|
|
||||||
@@ -66,8 +72,10 @@ To view the progress of the workflow run, use the `run watch` subcommand and sel
|
|||||||
gh run watch
|
gh run watch
|
||||||
```
|
```
|
||||||
|
|
||||||
## Running a workflow using the REST API
|
{% endcli %}
|
||||||
|
|
||||||
When using the REST API, you configure the `inputs` and `ref` as request body parameters. If the inputs are omitted, the default values defined in the workflow file are used.
|
### Running a workflow using the REST API
|
||||||
|
|
||||||
|
When using the REST API, you configure the `inputs` and `ref` as request body parameters. If the inputs are omitted, the default values defined in the workflow file are used.
|
||||||
|
|
||||||
For more information about using the REST API, see the "[Create a workflow dispatch event](/rest/reference/actions/#create-a-workflow-dispatch-event)."
|
For more information about using the REST API, see the "[Create a workflow dispatch event](/rest/reference/actions/#create-a-workflow-dispatch-event)."
|
||||||
|
|||||||
@@ -12,17 +12,23 @@ versions:
|
|||||||
{% data reusables.actions.enterprise-github-hosted-runners %}
|
{% data reusables.actions.enterprise-github-hosted-runners %}
|
||||||
{% data reusables.actions.ae-beta %}
|
{% data reusables.actions.ae-beta %}
|
||||||
|
|
||||||
## Re-run a workflow using the {% data variables.product.prodname_dotcom %} UI
|
|
||||||
|
|
||||||
{% data reusables.repositories.permissions-statement-write %}
|
{% data reusables.repositories.permissions-statement-write %}
|
||||||
|
|
||||||
|
{% include tool-switcher %}
|
||||||
|
|
||||||
|
{% webui %}
|
||||||
|
|
||||||
{% data reusables.repositories.navigate-to-repo %}
|
{% data reusables.repositories.navigate-to-repo %}
|
||||||
{% data reusables.repositories.actions-tab %}
|
{% data reusables.repositories.actions-tab %}
|
||||||
{% data reusables.repositories.navigate-to-workflow %}
|
{% data reusables.repositories.navigate-to-workflow %}
|
||||||
{% data reusables.repositories.view-run %}
|
{% data reusables.repositories.view-run %}
|
||||||
1. In the upper-right corner of the workflow, use the **Re-run jobs** drop-down menu, and select **Re-run all jobs**.{% ifversion fpt or ghes > 3.0 or ghae %}{% else %}{% endif %}
|
1. In the upper-right corner of the workflow, use the **Re-run jobs** drop-down menu, and select **Re-run all jobs**.{% ifversion fpt or ghes > 3.0 or ghae %}{% else %}{% endif %}
|
||||||
|
|
||||||
## Re-run a workflow using {% data variables.product.prodname_cli %}
|
{% endwebui %}
|
||||||
|
|
||||||
|
{% cli %}
|
||||||
|
|
||||||
|
{% data reusables.cli.download-cli %}
|
||||||
|
|
||||||
{% data reusables.actions.actions-cli %}
|
{% data reusables.actions.actions-cli %}
|
||||||
|
|
||||||
@@ -37,3 +43,5 @@ To view the progress of the workflow run, use the `run watch` subcommand and sel
|
|||||||
```shell
|
```shell
|
||||||
gh run watch
|
gh run watch
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% endcli %}
|
||||||
|
|||||||
@@ -13,16 +13,22 @@ shortTitle: View workflow run history
|
|||||||
{% data reusables.actions.enterprise-github-hosted-runners %}
|
{% data reusables.actions.enterprise-github-hosted-runners %}
|
||||||
{% data reusables.actions.ae-beta %}
|
{% data reusables.actions.ae-beta %}
|
||||||
|
|
||||||
## Viewing workflow run history on {% data variables.product.prodname_dotcom %}
|
|
||||||
|
|
||||||
{% data reusables.repositories.permissions-statement-read %}
|
{% data reusables.repositories.permissions-statement-read %}
|
||||||
|
|
||||||
|
{% include tool-switcher %}
|
||||||
|
|
||||||
|
{% webui %}
|
||||||
|
|
||||||
{% data reusables.repositories.navigate-to-repo %}
|
{% data reusables.repositories.navigate-to-repo %}
|
||||||
{% data reusables.repositories.actions-tab %}
|
{% data reusables.repositories.actions-tab %}
|
||||||
{% data reusables.repositories.navigate-to-workflow %}
|
{% data reusables.repositories.navigate-to-workflow %}
|
||||||
{% data reusables.repositories.view-run %}
|
{% data reusables.repositories.view-run %}
|
||||||
|
|
||||||
## Viewing workflow run history with {% data variables.product.prodname_cli %}
|
{% endwebui %}
|
||||||
|
|
||||||
|
{% cli %}
|
||||||
|
|
||||||
|
{% data reusables.cli.download-cli %}
|
||||||
|
|
||||||
{% data reusables.actions.actions-cli %}
|
{% data reusables.actions.actions-cli %}
|
||||||
|
|
||||||
@@ -77,3 +83,5 @@ Use the `--exit-status` flag to exit with a non-zero status if the run failed. F
|
|||||||
```shell
|
```shell
|
||||||
gh run view 0451 --exit-status && echo "run pending or passed"
|
gh run view 0451 --exit-status && echo "run pending or passed"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% endcli %}
|
||||||
|
|||||||
@@ -43,39 +43,50 @@ When creating your public repository from a fork of someone's project, make sure
|
|||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% note %}
|
## Prerequisties
|
||||||
|
|
||||||
**Note**: {% data reusables.repositories.desktop-fork %}
|
If you haven't yet, you should first [set up Git](/articles/set-up-git). Don't forget to [set up authentication to {% data variables.product.product_location %} from Git](/articles/set-up-git#next-steps-authenticating-with-github-from-git) as well.
|
||||||
|
|
||||||
{% endnote %}
|
## Forking a repository
|
||||||
|
|
||||||
{% ifversion fpt or ghes or ghae %}
|
{% include tool-switcher %}
|
||||||
{% tip %}
|
{% webui %}
|
||||||
|
|
||||||
**Tip**: You can also fork a repository using the {% data variables.product.prodname_cli %}. For more information, see "[`gh repo fork`](https://cli.github.com/manual/gh_repo_fork)" in the {% data variables.product.prodname_cli %} documentation.
|
You might fork a project to propose changes to the upstream, or original, repository. In this case, it's good practice to regularly sync your fork with the upstream repository. To do this, you'll need to use Git on the command line. You can practice setting the upstream repository using the same [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository you just forked.
|
||||||
|
|
||||||
{% endtip %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
## Fork an example repository
|
|
||||||
|
|
||||||
Forking a repository is a simple two-step process. We've created a repository for you to practice with.
|
|
||||||
|
|
||||||
1. On {% data variables.product.product_location %}, navigate to the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository.
|
1. On {% data variables.product.product_location %}, navigate to the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository.
|
||||||
2. In the top-right corner of the page, click **Fork**.
|
2. In the top-right corner of the page, click **Fork**.
|
||||||

|

|
||||||
|
|
||||||
## Keep your fork synced
|
{% endwebui %}
|
||||||
|
|
||||||
You might fork a project to propose changes to the upstream, or original, repository. In this case, it's good practice to regularly sync your fork with the upstream repository. To do this, you'll need to use Git on the command line. You can practice setting the upstream repository using the same [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository you just forked.
|
{% cli %}
|
||||||
|
|
||||||
### Step 1: Set up Git
|
{% data reusables.cli.download-cli %}
|
||||||
|
|
||||||
If you haven't yet, you should first [set up Git](/articles/set-up-git). Don't forget to [set up authentication to {% data variables.product.product_location %} from Git](/articles/set-up-git#next-steps-authenticating-with-github-from-git) as well.
|
To create a fork of a repository, use the `gh repo fork` subcommand.
|
||||||
|
|
||||||
### Step 2: Create a local clone of your fork
|
```shell
|
||||||
|
gh repo fork <em>repository</em>
|
||||||
|
```
|
||||||
|
|
||||||
Right now, you have a fork of the Spoon-Knife repository, but you don't have the files in that repository on your computer. Let's create a clone of your fork locally on your computer.
|
To create the fork in an organization, use the `--org` flag.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh repo fork <em>repository</em> --org "octo-org"
|
||||||
|
```
|
||||||
|
|
||||||
|
{% endcli %}
|
||||||
|
|
||||||
|
{% desktop %}
|
||||||
|
{% enddesktop %}
|
||||||
|
|
||||||
|
## Cloning your forked repository
|
||||||
|
|
||||||
|
Right now, you have a fork of the Spoon-Knife repository, but you don't have the files in that repository locally your computer.
|
||||||
|
|
||||||
|
{% include tool-switcher %}
|
||||||
|
{% webui %}
|
||||||
|
|
||||||
1. On {% data variables.product.product_name %}, navigate to **your fork** of the Spoon-Knife repository.
|
1. On {% data variables.product.product_name %}, navigate to **your fork** of the Spoon-Knife repository.
|
||||||
{% data reusables.repositories.copy-clone-url %}
|
{% data reusables.repositories.copy-clone-url %}
|
||||||
@@ -95,16 +106,42 @@ Right now, you have a fork of the Spoon-Knife repository, but you don't have the
|
|||||||
> remove: Total 10 (delta 1), reused 10 (delta 1)
|
> remove: Total 10 (delta 1), reused 10 (delta 1)
|
||||||
> Unpacking objects: 100% (10/10), done.
|
> Unpacking objects: 100% (10/10), done.
|
||||||
```
|
```
|
||||||
Now, you have a local copy of your fork of the Spoon-Knife repository.
|
|
||||||
|
|
||||||
### Step 3: Configure Git to sync your fork with the original Spoon-Knife repository
|
{% endwebui %}
|
||||||
|
|
||||||
|
{% cli %}
|
||||||
|
|
||||||
|
{% data reusables.cli.download-cli %}
|
||||||
|
|
||||||
|
To create a clone of your fork, use the `--clone` flag.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh repo fork <em>repository</em> --clone=true
|
||||||
|
```
|
||||||
|
|
||||||
|
{% endcli %}
|
||||||
|
|
||||||
|
{% desktop %}
|
||||||
|
|
||||||
|
{% data reusables.desktop.choose-clone-repository %}
|
||||||
|
{% data reusables.desktop.cloning-location-tab %}
|
||||||
|
{% data reusables.desktop.cloning-repository-list %}
|
||||||
|
{% data reusables.desktop.choose-local-path %}
|
||||||
|
{% data reusables.desktop.click-clone %}
|
||||||
|
|
||||||
|
{% enddesktop %}
|
||||||
|
|
||||||
|
## Configuring Git to sync your fork with the original repository
|
||||||
|
|
||||||
When you fork a project in order to propose changes to the original repository, you can configure Git to pull changes from the original, or upstream, repository into the local clone of your fork.
|
When you fork a project in order to propose changes to the original repository, you can configure Git to pull changes from the original, or upstream, repository into the local clone of your fork.
|
||||||
|
|
||||||
|
{% include tool-switcher %}
|
||||||
|
{% webui %}
|
||||||
|
|
||||||
1. On {% data variables.product.product_name %}, navigate to the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository.
|
1. On {% data variables.product.product_name %}, navigate to the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository.
|
||||||
{% data reusables.repositories.copy-clone-url %}
|
{% data reusables.repositories.copy-clone-url %}
|
||||||
{% data reusables.command_line.open_the_multi_os_terminal %}
|
{% data reusables.command_line.open_the_multi_os_terminal %}
|
||||||
4. Change directories to the location of the fork you cloned in [Step 2: Create a local clone of your fork](#step-2-create-a-local-clone-of-your-fork).
|
4. Change directories to the location of the fork you cloned.
|
||||||
- To go to your home directory, type just `cd` with no other text.
|
- To go to your home directory, type just `cd` with no other text.
|
||||||
- To list the files and folders in your current directory, type `ls`.
|
- To list the files and folders in your current directory, type `ls`.
|
||||||
- To go into one of your listed directories, type `cd your_listed_directory`.
|
- To go into one of your listed directories, type `cd your_listed_directory`.
|
||||||
@@ -132,6 +169,26 @@ When you fork a project in order to propose changes to the original repository,
|
|||||||
|
|
||||||
Now, you can keep your fork synced with the upstream repository with a few Git commands. For more information, see "[Syncing a fork](/articles/syncing-a-fork)."
|
Now, you can keep your fork synced with the upstream repository with a few Git commands. For more information, see "[Syncing a fork](/articles/syncing-a-fork)."
|
||||||
|
|
||||||
|
{% endwebui %}
|
||||||
|
|
||||||
|
{% cli %}
|
||||||
|
|
||||||
|
{% data reusables.cli.download-cli %}
|
||||||
|
|
||||||
|
To configure a remote repository for the forked repository, use the `--remote` flag.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh repo fork <em>repository</em> --remote=true
|
||||||
|
```
|
||||||
|
|
||||||
|
To specify the remote repository's name, use the `--remote-name` flag.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh repo fork <em>repository</em> --remote-name "main-remote-repo"
|
||||||
|
```
|
||||||
|
|
||||||
|
{% endcli %}
|
||||||
|
|
||||||
### Next steps
|
### Next steps
|
||||||
|
|
||||||
You can make any changes to a fork, including:
|
You can make any changes to a fork, including:
|
||||||
|
|||||||
@@ -20,16 +20,11 @@ After adding a new SSH key to your {% data variables.product.product_name %} acc
|
|||||||
|
|
||||||
{% data reusables.ssh.dsa-support %}
|
{% data reusables.ssh.dsa-support %}
|
||||||
|
|
||||||
{% ifversion fpt or ghae or ghes %}
|
|
||||||
{% tip %}
|
|
||||||
|
|
||||||
**Tip**: You can also add an SSH key using the {% data variables.product.prodname_cli %}. For more information, see "[`gh ssh-key add`](https://cli.github.com/manual/gh_ssh-key_add)" in the {% data variables.product.prodname_cli %} documentation.
|
|
||||||
|
|
||||||
{% endtip %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% mac %}
|
{% mac %}
|
||||||
|
|
||||||
|
{% include tool-switcher %}
|
||||||
|
{% webui %}
|
||||||
|
|
||||||
1. Copy the SSH public key to your clipboard.
|
1. Copy the SSH public key to your clipboard.
|
||||||
|
|
||||||
If your SSH public key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don't add any newlines or whitespace.
|
If your SSH public key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don't add any newlines or whitespace.
|
||||||
@@ -56,10 +51,16 @@ After adding a new SSH key to your {% data variables.product.product_name %} acc
|
|||||||

|

|
||||||
{% data reusables.user_settings.sudo-mode-popup %}
|
{% data reusables.user_settings.sudo-mode-popup %}
|
||||||
|
|
||||||
|
{% endwebui %}
|
||||||
|
|
||||||
{% endmac %}
|
{% endmac %}
|
||||||
|
|
||||||
{% windows %}
|
{% windows %}
|
||||||
|
|
||||||
|
{% include tool-switcher %}
|
||||||
|
|
||||||
|
{% webui %}
|
||||||
|
|
||||||
1. Copy the SSH public key to your clipboard.
|
1. Copy the SSH public key to your clipboard.
|
||||||
|
|
||||||
If your SSH public key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don't add any newlines or whitespace.
|
If your SSH public key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don't add any newlines or whitespace.
|
||||||
@@ -87,10 +88,15 @@ After adding a new SSH key to your {% data variables.product.product_name %} acc
|
|||||||
8. If prompted, confirm your {% data variables.product.product_name %} password.
|
8. If prompted, confirm your {% data variables.product.product_name %} password.
|
||||||

|

|
||||||
|
|
||||||
|
{% endwebui %}
|
||||||
|
|
||||||
{% endwindows %}
|
{% endwindows %}
|
||||||
|
|
||||||
{% linux %}
|
{% linux %}
|
||||||
|
|
||||||
|
{% include tool-switcher %}
|
||||||
|
{% webui %}
|
||||||
|
|
||||||
1. Copy the SSH public key to your clipboard.
|
1. Copy the SSH public key to your clipboard.
|
||||||
|
|
||||||
If your SSH public key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don't add any newlines or whitespace.
|
If your SSH public key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don't add any newlines or whitespace.
|
||||||
@@ -121,8 +127,28 @@ After adding a new SSH key to your {% data variables.product.product_name %} acc
|
|||||||
8. If prompted, confirm your {% data variables.product.product_name %} password.
|
8. If prompted, confirm your {% data variables.product.product_name %} password.
|
||||||

|

|
||||||
|
|
||||||
|
{% endwebui %}
|
||||||
|
|
||||||
{% endlinux %}
|
{% endlinux %}
|
||||||
|
|
||||||
|
{% cli %}
|
||||||
|
|
||||||
|
{% data reusables.cli.download-cli %}
|
||||||
|
|
||||||
|
To add an SSH key to your GitHub account, use the `ssh-key add` subcommand.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh ssh-key add <em>key-file</em>
|
||||||
|
```
|
||||||
|
|
||||||
|
To include a title for the new key, use the `-t` or `--title` flag.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh ssh-key add <em>key-file</em> --title "personal laptop"
|
||||||
|
```
|
||||||
|
|
||||||
|
{% endcli %}
|
||||||
|
|
||||||
{% ifversion fpt %}
|
{% ifversion fpt %}
|
||||||
## Further reading
|
## Further reading
|
||||||
|
|
||||||
|
|||||||
@@ -20,14 +20,6 @@ You can specify which branch you'd like to merge your changes into when you crea
|
|||||||
|
|
||||||
{% data reusables.pull_requests.close-issues-using-keywords %}
|
{% data reusables.pull_requests.close-issues-using-keywords %}
|
||||||
|
|
||||||
{% ifversion fpt or ghae or ghes %}
|
|
||||||
{% tip %}
|
|
||||||
|
|
||||||
**Tip**: You can create a pull request using the {% data variables.product.prodname_cli %}. For more information, see "[`gh pr create`](https://cli.github.com/manual/gh_pr_create)" in the {% data variables.product.prodname_cli %} documentation.
|
|
||||||
|
|
||||||
{% endtip %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
## Changing the branch range and destination repository
|
## Changing the branch range and destination repository
|
||||||
|
|
||||||
By default, pull requests are based on the parent repository's default branch. For more information, see "[About branches](/github/collaborating-with-issues-and-pull-requests/about-branches#about-the-default-branch)."
|
By default, pull requests are based on the parent repository's default branch. For more information, see "[About branches](/github/collaborating-with-issues-and-pull-requests/about-branches#about-the-default-branch)."
|
||||||
@@ -52,11 +44,9 @@ When you change any of the information in the branch range, the Commit and Files
|
|||||||
|
|
||||||
## Creating the pull request
|
## Creating the pull request
|
||||||
|
|
||||||
{% tip %}
|
{% include tool-switcher %}
|
||||||
|
|
||||||
**Tip**: You can also use {% data variables.product.prodname_desktop %} to create a pull request. For more information, see “[Creating an issue or pull request](/desktop/contributing-to-projects/creating-an-issue-or-pull-request)" in the {% data variables.product.prodname_desktop %} documentation.
|
{% webui %}
|
||||||
|
|
||||||
{% endtip %}
|
|
||||||
|
|
||||||
{% data reusables.repositories.navigate-to-repo %}
|
{% data reusables.repositories.navigate-to-repo %}
|
||||||
2. In the "Branch" menu, choose the branch that contains your commits.
|
2. In the "Branch" menu, choose the branch that contains your commits.
|
||||||
@@ -71,6 +61,96 @@ When you change any of the information in the branch range, the Commit and Files
|
|||||||
|
|
||||||
After your pull request has been reviewed, it can be [merged into the repository](/articles/merging-a-pull-request).
|
After your pull request has been reviewed, it can be [merged into the repository](/articles/merging-a-pull-request).
|
||||||
|
|
||||||
|
{% endwebui %}
|
||||||
|
|
||||||
|
{% cli %}
|
||||||
|
|
||||||
|
{% data reusables.cli.download-cli %}
|
||||||
|
|
||||||
|
To create a pull request, use the `gh pr create` subcommand.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh pr create
|
||||||
|
```
|
||||||
|
|
||||||
|
To assign a pull request to an individual, use the `--assignee` or `-a` flags. You can use `@me` to self-assign the pull request.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh pr create --assignee "@octocat"
|
||||||
|
```
|
||||||
|
|
||||||
|
To specify the branch into which you want the pull request merged, use the `--base` or `-B` flags. To specify the branch that contains commits for your pull request, use the `--head` or `-H` flags.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh pr create --base my-base-branch --head my-changed-branch
|
||||||
|
```
|
||||||
|
|
||||||
|
To include a title and body for the new pull request, use the `--title` and `--body` flags.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh pr create --title "The bug is fixed" --body "Everything works again"
|
||||||
|
```
|
||||||
|
|
||||||
|
To mark a pull request as a draft, use the `--draft` flag.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh pr create --draft
|
||||||
|
```
|
||||||
|
|
||||||
|
To add a labels or milestones to the new pull request, use the `--label` and `--milestone` flags.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh pr create --label "bug,help wanted" --milestone octocat-milestone
|
||||||
|
```
|
||||||
|
|
||||||
|
To add the new pull request to a specific project, use the `--project` flag.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh pr create --project octocat-project
|
||||||
|
```
|
||||||
|
|
||||||
|
To assign an individual or team as reviewers, use the `--reviewer` flag.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh pr create --reviewer monalisa,hubot --reviewer myorg/team-name
|
||||||
|
```
|
||||||
|
|
||||||
|
To create the pull request in your default web browser, use the `--web` flag.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh pr create --web
|
||||||
|
```
|
||||||
|
|
||||||
|
{% endcli %}
|
||||||
|
|
||||||
|
{% desktop %}
|
||||||
|
|
||||||
|
{% mac %}
|
||||||
|
|
||||||
|
1. Switch to the branch that you want to create a pull request for. For more information, see "[Switching between branches](/desktop/contributing-and-collaborating-using-github-desktop/managing-branches#switching-between-branches)."
|
||||||
|
2. Click **Create Pull Request**. {% data variables.product.prodname_desktop %} will open your default browser to take you to {% data variables.product.prodname_dotcom %}.
|
||||||
|

|
||||||
|
4. On {% data variables.product.prodname_dotcom %}, confirm that the branch in the **base:** drop-down menu is the branch where you want to merge your changes. Confirm that the branch in the **compare:** drop-down menu is the topic branch where you made your changes.
|
||||||
|

|
||||||
|
{% data reusables.repositories.pr-title-description %}
|
||||||
|
{% data reusables.repositories.create-pull-request %}
|
||||||
|
|
||||||
|
{% endmac %}
|
||||||
|
|
||||||
|
{% windows %}
|
||||||
|
|
||||||
|
1. Switch to the branch that you want to create a pull request for. For more information, see "[Switching between branches](/desktop/contributing-and-collaborating-using-github-desktop/managing-branches#switching-between-branches)."
|
||||||
|
2. Click **Create Pull Request**. {% data variables.product.prodname_desktop %} will open your default browser to take you to {% data variables.product.prodname_dotcom %}.
|
||||||
|

|
||||||
|
3. On {% data variables.product.prodname_dotcom %}, confirm that the branch in the **base:** drop-down menu is the branch where you want to merge your changes. Confirm that the branch in the **compare:** drop-down menu is the topic branch where you made your changes.
|
||||||
|

|
||||||
|
{% data reusables.repositories.pr-title-description %}
|
||||||
|
{% data reusables.repositories.create-pull-request %}
|
||||||
|
|
||||||
|
{% endwindows %}
|
||||||
|
|
||||||
|
{% enddesktop %}
|
||||||
|
|
||||||
## Further reading
|
## Further reading
|
||||||
|
|
||||||
- "[Creating a pull request from a fork](/articles/creating-a-pull-request-from-a-fork)"
|
- "[Creating a pull request from a fork](/articles/creating-a-pull-request-from-a-fork)"
|
||||||
|
|||||||
@@ -19,15 +19,11 @@ Cloning a repository pulls down a full copy of all the repository data that {% d
|
|||||||
|
|
||||||
You can clone your existing repository or clone another person's existing repository to contribute to a project.
|
You can clone your existing repository or clone another person's existing repository to contribute to a project.
|
||||||
|
|
||||||
{% ifversion fpt or ghae or ghes %}
|
## Cloning a repository
|
||||||
{% tip %}
|
|
||||||
|
|
||||||
**Tip**: You can also clone a repository using the {% data variables.product.prodname_cli %}. For more information, see "[`gh repo clone`](https://cli.github.com/manual/gh_repo_clone)" in the {% data variables.product.prodname_cli %} documentation.
|
{% include tool-switcher %}
|
||||||
|
|
||||||
{% endtip %}
|
{% webui %}
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
## Cloning a repository using the command line
|
|
||||||
|
|
||||||
{% data reusables.repositories.navigate-to-repo %}
|
{% data reusables.repositories.navigate-to-repo %}
|
||||||
{% data reusables.repositories.copy-clone-url %}
|
{% data reusables.repositories.copy-clone-url %}
|
||||||
@@ -36,7 +32,27 @@ You can clone your existing repository or clone another person's existing reposi
|
|||||||
{% data reusables.command_line.git-clone-url %}
|
{% data reusables.command_line.git-clone-url %}
|
||||||
{% data reusables.command_line.local-clone-created %}
|
{% data reusables.command_line.local-clone-created %}
|
||||||
|
|
||||||
## Cloning a repository to {% data variables.product.prodname_desktop %}
|
{% endwebui %}
|
||||||
|
|
||||||
|
{% cli %}
|
||||||
|
|
||||||
|
{% data reusables.cli.download-cli %}
|
||||||
|
|
||||||
|
To clone a repository locally, use the `repo clone` subcommand. Replace the `repository` parameter with the repository name. For example, `octo-org/octo-repo`, `monalisa/octo-repo`, or `octo-repo`. If the `OWNER/` portion of the `OWNER/REPO` repository argument is omitted, it defaults to the name of the authenticating user.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh repo clone <em>repository</em>
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also use the GitHub URL to clone a repository.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gh repo clone <em>https://github.com/cli/cli</em>
|
||||||
|
```
|
||||||
|
|
||||||
|
{% endcli %}
|
||||||
|
|
||||||
|
{% desktop %}
|
||||||
|
|
||||||
{% data reusables.repositories.navigate-to-repo %}
|
{% data reusables.repositories.navigate-to-repo %}
|
||||||
{% data reusables.repositories.open-with-github-desktop %}
|
{% data reusables.repositories.open-with-github-desktop %}
|
||||||
@@ -44,6 +60,8 @@ You can clone your existing repository or clone another person's existing reposi
|
|||||||
|
|
||||||
For more information, see "[Cloning a repository from {% data variables.product.prodname_dotcom %} to {% data variables.product.prodname_desktop %}](/desktop/guides/contributing-to-projects/cloning-a-repository-from-github-to-github-desktop/)."
|
For more information, see "[Cloning a repository from {% data variables.product.prodname_dotcom %} to {% data variables.product.prodname_desktop %}](/desktop/guides/contributing-to-projects/cloning-a-repository-from-github-to-github-desktop/)."
|
||||||
|
|
||||||
|
{% enddesktop %}
|
||||||
|
|
||||||
## Cloning an empty repository
|
## Cloning an empty repository
|
||||||
|
|
||||||
An empty repository contains no files. It's often made if you don't initialize the repository with a README when creating it.
|
An empty repository contains no files. It's often made if you don't initialize the repository with a README when creating it.
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ In all of the following cURL examples, replace `TOKEN` with a token that has the
|
|||||||
|
|
||||||
{% cli %}
|
{% cli %}
|
||||||
|
|
||||||
Before running {% data variables.product.prodname_cli %} commands, you must authenticate by running `gh auth login` and providing an authentication token that has the `read:org` scope (for queries) or `write:org` scope (for queries and mutations). During the beta, you will not be able to authenticate using a web browser. For more information on command line authentication, see "[gh auth login](https://cli.github.com/manual/gh_auth_login)." For more information about creating a token, see "[Creating a personal access token](/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)."
|
{% data reusables.cli.download-cli %}
|
||||||
|
|
||||||
To download or find more information about {% data variables.product.prodname_cli %}, see the [{% data variables.product.prodname_cli %} manual](https://cli.github.com/manual/).
|
Before running {% data variables.product.prodname_cli %} commands, you must authenticate by running `gh auth login` and providing an authentication token that has the `read:org` scope (for queries) or `write:org` scope (for queries and mutations). During the beta, you will not be able to authenticate using a web browser. For more information on command line authentication, see "[gh auth login](https://cli.github.com/manual/gh_auth_login)." For more information about creating a token, see "[Creating a personal access token](/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)."
|
||||||
|
|
||||||
{% endcli %}
|
{% endcli %}
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ To download or find more information about {% data variables.product.prodname_cl
|
|||||||
|
|
||||||
## Using variables
|
## Using variables
|
||||||
|
|
||||||
In all of the following examples, you can use variables to simplify your scripts. Use `-F` to pass a variable that is a number, Boolean, or null. Use `-f` for other variables. For example,
|
In all of the following examples, you can use variables to simplify your scripts. Use `-F` to pass a variable that is a number, Boolean, or null. Use `-f` for other variables. For example,
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
my_org="octo-org"
|
my_org="octo-org"
|
||||||
@@ -152,7 +152,7 @@ gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
|
|||||||
name
|
name
|
||||||
settings
|
settings
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}'
|
}'
|
||||||
@@ -218,7 +218,7 @@ gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
|
|||||||
items(first: 20) {
|
items(first: 20) {
|
||||||
nodes{
|
nodes{
|
||||||
title
|
title
|
||||||
id
|
id
|
||||||
fieldValues(first: 8) {
|
fieldValues(first: 8) {
|
||||||
nodes{
|
nodes{
|
||||||
value
|
value
|
||||||
@@ -361,10 +361,10 @@ gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
|
|||||||
|
|
||||||
### Updating a single-select field
|
### Updating a single-select field
|
||||||
|
|
||||||
The following example will update a date field.
|
The following example will update a date field.
|
||||||
- `PROJECT_ID` - Replace this with the node ID of your project.
|
- `PROJECT_ID` - Replace this with the node ID of your project.
|
||||||
- `ITEM_ID` - Replace this with the node ID of the item you want to update.
|
- `ITEM_ID` - Replace this with the node ID of the item you want to update.
|
||||||
- `FIELD_ID` - Replace this with the ID of the field that you want to update.
|
- `FIELD_ID` - Replace this with the ID of the field that you want to update.
|
||||||
- `OPTION_ID` - Replace this with the ID of the desired value.
|
- `OPTION_ID` - Replace this with the ID of the desired value.
|
||||||
|
|
||||||
{% include tool-switcher %}
|
{% include tool-switcher %}
|
||||||
|
|||||||
1
data/reusables/cli/download-cli.md
Normal file
1
data/reusables/cli/download-cli.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
To download or find more information about {% data variables.product.prodname_cli %}, see the [{% data variables.product.prodname_cli %} feature page](https://cli.github.com/).
|
||||||
Reference in New Issue
Block a user