mirror of
https://github.com/tldr-pages/tldr.git
synced 2026-08-28 11:25:16 +08:00
gh-*: update pages (#18120)
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
- List all the aliases `gh` is configured to use:
|
||||
|
||||
`gh alias list`
|
||||
`gh alias {{[ls|list]}}`
|
||||
|
||||
- Create a `gh` subcommand alias:
|
||||
|
||||
|
||||
@@ -5,32 +5,32 @@
|
||||
|
||||
- Create a codespace in GitHub interactively:
|
||||
|
||||
`gh codespace create`
|
||||
`gh {{[cs|codespace]}} create`
|
||||
|
||||
- List all available codespaces:
|
||||
|
||||
`gh codespace list`
|
||||
`gh {{[cs|codespace]}} {{[ls|list]}}`
|
||||
|
||||
- Connect to a codespace via SSH interactively:
|
||||
|
||||
`gh codespace ssh`
|
||||
`gh {{[cs|codespace]}} ssh`
|
||||
|
||||
- Transfer a specific file to a codespace interactively:
|
||||
|
||||
`gh codespace cp {{path/to/source_file}} remote:{{path/to/remote_file}}`
|
||||
`gh {{[cs|codespace]}} cp {{path/to/source_file}} remote:{{path/to/remote_file}}`
|
||||
|
||||
- List the ports of a codespace interactively:
|
||||
|
||||
`gh codespace ports`
|
||||
`gh {{[cs|codespace]}} ports`
|
||||
|
||||
- Display the logs from a codespace interactively:
|
||||
|
||||
`gh codespace logs`
|
||||
`gh {{[cs|codespace]}} logs`
|
||||
|
||||
- Delete a codespace interactively:
|
||||
|
||||
`gh codespace delete`
|
||||
`gh {{[cs|codespace]}} delete`
|
||||
|
||||
- Display help for a subcommand:
|
||||
|
||||
`gh codespace {{code|cp|create|delete|edit|...}} --help`
|
||||
`gh {{[cs|codespace]}} {{code|cp|create|delete|edit|...}} {{[-h|--help]}}`
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
- Append the `gh` completion script to `~/.bashrc`:
|
||||
|
||||
`gh completion {{[-s|--shell]}} {{bash}} >> {{~/.bashrc}}`
|
||||
`gh completion {{[-s|--shell]}} bash >> ~/.bashrc`
|
||||
|
||||
- Append the `gh` completion script to `~/.zshrc`:
|
||||
|
||||
`gh completion {{[-s|--shell]}} {{zsh}} >> {{~/.zshrc}}`
|
||||
`gh completion {{[-s|--shell]}} zsh >> ~/.zshrc`
|
||||
|
||||
- Display the subcommand help:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# gh config
|
||||
|
||||
> Change configuration for GitHub cli.
|
||||
> Change configuration for GitHub CLI.
|
||||
> More information: <https://cli.github.com/manual/gh_config>.
|
||||
|
||||
- Display what Git protocol is being used:
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
- Set protocol to SSH:
|
||||
|
||||
`gh config set git_protocol {{ssh}}`
|
||||
`gh config set git_protocol ssh`
|
||||
|
||||
- Use `delta` in side-by-side mode as the default pager for all `gh` commands:
|
||||
|
||||
`gh config set pager '{{delta --side-by-side}}'`
|
||||
`gh config set pager 'delta --side-by-side'`
|
||||
|
||||
- Set text editor to Vim:
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
- List installed extensions:
|
||||
|
||||
`gh {{[ext|extension]}} list`
|
||||
`gh {{[ext|extension]}} {{[ls|list]}}`
|
||||
|
||||
- Upgrade a specific extension:
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
- List installed extensions:
|
||||
|
||||
`gh {{[ext|extension]}} list`
|
||||
`gh {{[ext|extension]}} {{[ls|list]}}`
|
||||
|
||||
- Remove an extension:
|
||||
|
||||
@@ -33,4 +33,4 @@
|
||||
|
||||
- Display help about a subcommand:
|
||||
|
||||
`gh {{[ext|extension]}} {{subcommand}} --help`
|
||||
`gh {{[ext|extension]}} {{subcommand}} {{[-h|--help]}}`
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
- Create a new Gist from one or more files:
|
||||
|
||||
`gh gist create {{path/to/file1 path/to/file2 ...}}`
|
||||
`gh gist {{[new|create]}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Create a new Gist with a specific [desc]ription:
|
||||
|
||||
`gh gist create {{path/to/file1 path/to/file2 ...}} {{[-d|--desc]}} "{{description}}"`
|
||||
`gh gist {{[new|create]}} {{path/to/file1 path/to/file2 ...}} {{[-d|--desc]}} "{{description}}"`
|
||||
|
||||
- Edit a Gist:
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
- List up to 42 Gists owned by the currently logged in user:
|
||||
|
||||
`gh gist list {{[-L|--limit]}} {{42}}`
|
||||
`gh gist {{[ls|list]}} {{[-L|--limit]}} 42`
|
||||
|
||||
- View a Gist in the default browser without rendering Markdown:
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
- Display help for the `gh help` subcommand:
|
||||
|
||||
`gh help --help`
|
||||
`gh help {{[-h|--help]}}`
|
||||
|
||||
- Display help about environment variables that can be used with `gh`:
|
||||
|
||||
|
||||
@@ -5,28 +5,28 @@
|
||||
|
||||
- Create a new issue against the current repository interactively:
|
||||
|
||||
`gh issue create`
|
||||
`gh issue {{[new|create]}}`
|
||||
|
||||
- Create a new issue with the `bug` label interactively:
|
||||
|
||||
`gh issue create {{[-l|--label]}} "{{bug}}"`
|
||||
`gh issue {{[new|create]}} {{[-l|--label]}} "bug"`
|
||||
|
||||
- Create a new issue interactively and assign it to the specified users:
|
||||
|
||||
`gh issue create {{[-a|--assignee]}} {{user1,user2,...}}`
|
||||
`gh issue {{[new|create]}} {{[-a|--assignee]}} {{user1,user2,...}}`
|
||||
|
||||
- Create a new issue with a title, body and assign it to the current user:
|
||||
|
||||
`gh issue create {{[-t|--title]}} "{{title}}" {{[-b|--body]}} "{{body}}" {{[-a|--assignee]}} "{{@me}}"`
|
||||
`gh issue {{[new|create]}} {{[-t|--title]}} "{{title}}" {{[-b|--body]}} "{{body}}" {{[-a|--assignee]}} "@me"`
|
||||
|
||||
- Create a new issue interactively, reading the body text from a file:
|
||||
|
||||
`gh issue create {{[-F|--body-file]}} {{path/to/file}}`
|
||||
`gh issue {{[new|create]}} {{[-F|--body-file]}} {{path/to/file}}`
|
||||
|
||||
- Create a new issue in the default web browser:
|
||||
|
||||
`gh issue create {{[-w|--web]}}`
|
||||
`gh issue {{[new|create]}} {{[-w|--web]}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`gh issue create --help`
|
||||
`gh issue {{[new|create]}} {{[-h|--help]}}`
|
||||
|
||||
@@ -13,15 +13,15 @@
|
||||
|
||||
- Create a new issue in the default web browser:
|
||||
|
||||
`gh issue create {{[-w|--web]}}`
|
||||
`gh issue {{[new|create]}} {{[-w|--web]}}`
|
||||
|
||||
- List the last 10 issues with the `bug` label:
|
||||
|
||||
`gh issue list {{[-L|--limit]}} {{10}} {{[-l|--label]}} "{{bug}}"`
|
||||
`gh issue {{[ls|list]}} {{[-L|--limit]}} 10 {{[-l|--label]}} "bug"`
|
||||
|
||||
- List closed issues made by a specific user:
|
||||
|
||||
`gh issue list {{[-s|--state]}} closed {{[-A|--author]}} {{username}}`
|
||||
`gh issue {{[ls|list]}} {{[-s|--state]}} closed {{[-A|--author]}} {{username}}`
|
||||
|
||||
- Display the status of issues relevant to the user, in a specific repository:
|
||||
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
- List labels for the repository in the current directory:
|
||||
|
||||
`gh label list`
|
||||
`gh label {{[ls|list]}}`
|
||||
|
||||
- View labels for the repository in the current directory in the default web browser:
|
||||
|
||||
`gh label list {{[-w|--web]}}`
|
||||
`gh label {{[ls|list]}} {{[-w|--web]}}`
|
||||
|
||||
- Create a label with a specific name, description and color in hexadecimal format for the repository in the current directory:
|
||||
|
||||
@@ -29,4 +29,4 @@
|
||||
|
||||
- Display help for a subcommand:
|
||||
|
||||
`gh label {{subcommand}} --help`
|
||||
`gh label {{subcommand}} {{[-h|--help]}}`
|
||||
|
||||
@@ -5,20 +5,20 @@
|
||||
|
||||
- Interactively create a pull request:
|
||||
|
||||
`gh pr create`
|
||||
`gh pr {{[new|create]}}`
|
||||
|
||||
- Create a pull request, determining the title and description from the commit messages of the current branch:
|
||||
|
||||
`gh pr create {{[-f|--fill]}}`
|
||||
`gh pr {{[new|create]}} {{[-f|--fill]}}`
|
||||
|
||||
- Create a draft pull request:
|
||||
|
||||
`gh pr create {{[-d|--draft]}}`
|
||||
`gh pr {{[new|create]}} {{[-d|--draft]}}`
|
||||
|
||||
- Create a pull request specifying the base branch, title, and description:
|
||||
|
||||
`gh pr create {{[-B|--base]}} {{base_branch}} {{[-t|--title]}} "{{title}}" {{[-b|--body]}} "{{body}}"`
|
||||
`gh pr {{[new|create]}} {{[-B|--base]}} {{base_branch}} {{[-t|--title]}} "{{title}}" {{[-b|--body]}} "{{body}}"`
|
||||
|
||||
- Start opening a pull request in the default web browser:
|
||||
|
||||
`gh pr create {{[-w|--web]}}`
|
||||
`gh pr {{[new|create]}} {{[-w|--web]}}`
|
||||
|
||||
@@ -29,4 +29,4 @@
|
||||
|
||||
- Display help:
|
||||
|
||||
`gh pr merge --help`
|
||||
`gh pr merge {{[-h|--help]}}`
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
|
||||
- Create a pull request:
|
||||
|
||||
`gh pr create`
|
||||
`gh pr {{[new|create]}}`
|
||||
|
||||
- Check out a specific pull request locally:
|
||||
|
||||
`gh pr checkout {{pr_number}}`
|
||||
`gh {{[co|pr checkout]}} {{pr_number|url|branch}}`
|
||||
|
||||
- View the changes made in the pull request for the current branch:
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
- List releases in a GitHub repository, limited to 30 items:
|
||||
|
||||
`gh release list`
|
||||
`gh release {{[ls|list]}}`
|
||||
|
||||
- Display information about a specific release:
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
- Create a new release:
|
||||
|
||||
`gh release create {{tag}}`
|
||||
`gh release {{[new|create]}} {{tag}}`
|
||||
|
||||
- Delete a specific release:
|
||||
|
||||
|
||||
@@ -5,20 +5,20 @@
|
||||
|
||||
- Create a new repository interactively:
|
||||
|
||||
`gh repo create`
|
||||
`gh repo {{[new|create]}}`
|
||||
|
||||
- Create a new repository with a specified name and description:
|
||||
|
||||
`gh repo create {{repo_name}} {{[-d|--description]}} "{{repo_description}}"`
|
||||
`gh repo {{[new|create]}} {{repo_name}} {{[-d|--description]}} "{{repo_description}}"`
|
||||
|
||||
- Create a private repository from the current directory:
|
||||
|
||||
`gh repo create {{[-s|--source]}} . --private`
|
||||
`gh repo {{[new|create]}} {{[-s|--source]}} . --private`
|
||||
|
||||
- Clone the new repository locally after creation:
|
||||
|
||||
`gh repo create {{repo_name}} {{[-c|--clone]}}`
|
||||
`gh repo {{[new|create]}} {{repo_name}} {{[-c|--clone]}}`
|
||||
|
||||
- Push the current directory to a new GitHub repository:
|
||||
|
||||
`gh repo create {{[-s|--source]}} . --public`
|
||||
`gh repo {{[new|create]}} {{[-s|--source]}} . --public`
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
- Create a new repository (if the repository name is not set, the default name will be the name of the current directory):
|
||||
|
||||
`gh repo create {{name}}`
|
||||
`gh repo {{[new|create]}} {{name}}`
|
||||
|
||||
- Clone a repository:
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
|
||||
- List repositories owned by a specific user or organization (if the owner is not set, the default owner will be the currently logged in user):
|
||||
|
||||
`gh repo list {{owner}}`
|
||||
`gh repo {{[ls|list]}} {{owner}}`
|
||||
|
||||
- List only non-forks repositories and limit the number of repositories to list (default: 30):
|
||||
|
||||
`gh repo list {{owner}} --source {{[-L|--limit]}} {{limit}}`
|
||||
`gh repo {{[ls|list]}} {{owner}} --source {{[-L|--limit]}} {{limit}}`
|
||||
|
||||
- List repositories with a specific primary coding language:
|
||||
|
||||
`gh repo list {{owner}} {{[-l|--language]}} {{language_name}}`
|
||||
`gh repo {{[ls|list]}} {{owner}} {{[-l|--language]}} {{language_name}}`
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
|
||||
- Run the "marquee" screensaver with a specific text and font:
|
||||
|
||||
`gh screensaver {{[-s|--saver]}} {{marquee}} -- --message="{{message}}" --font={{font_name}}`
|
||||
`gh screensaver {{[-s|--saver]}} marquee -- --message="{{message}}" --font={{font_name}}`
|
||||
|
||||
- Run the "starfield" screensaver with a specific density and speed:
|
||||
|
||||
`gh screensaver {{[-s|--saver]}} {{starfield}} -- --density {{500}} --speed {{10}}`
|
||||
`gh screensaver {{[-s|--saver]}} starfield -- --density {{500}} --speed {{10}}`
|
||||
|
||||
- List available screensavers:
|
||||
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
|
||||
- List secret keys for the current repository:
|
||||
|
||||
`gh secret list`
|
||||
`gh secret {{[ls|list]}}`
|
||||
|
||||
- List secret keys for a specific organization:
|
||||
|
||||
`gh secret list {{[-o|--org]}} {{organization}}`
|
||||
`gh secret {{[ls|list]}} {{[-o|--org]}} {{organization}}`
|
||||
|
||||
- List secret keys for a specific repository:
|
||||
|
||||
`gh secret list {{[-R|--repo]}} {{owner}}/{{repository}}`
|
||||
`gh secret {{[ls|list]}} {{[-R|--repo]}} {{owner}}/{{repository}}`
|
||||
|
||||
- Set a secret for the current repository (user will be prompted for the value):
|
||||
|
||||
|
||||
@@ -3,13 +3,9 @@
|
||||
> Manage GitHub SSH keys.
|
||||
> More information: <https://cli.github.com/manual/gh_ssh-key>.
|
||||
|
||||
- Display help:
|
||||
|
||||
`gh ssh-key`
|
||||
|
||||
- List SSH keys for the currently authenticated user:
|
||||
|
||||
`gh ssh-key list`
|
||||
`gh ssh-key {{[ls|list]}}`
|
||||
|
||||
- Add an SSH key to the currently authenticated user's account:
|
||||
|
||||
@@ -18,3 +14,7 @@
|
||||
- Add an SSH key to the currently authenticated user's account with a specific title:
|
||||
|
||||
`gh ssh-key add {{[-t|--title]}} {{title}} {{path/to/key.pub}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`gh ssh-key`
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
- List workflow files (use `--all` to include disabled workflows):
|
||||
|
||||
`gh workflow list`
|
||||
`gh workflow {{[ls|list]}}`
|
||||
|
||||
- Run a manual workflow with parameters:
|
||||
|
||||
|
||||
+4
-4
@@ -10,11 +10,11 @@
|
||||
|
||||
- Create a new issue:
|
||||
|
||||
`gh issue create`
|
||||
`gh issue {{[new|create]}}`
|
||||
|
||||
- View and filter the open issues of the current repository:
|
||||
|
||||
`gh issue list`
|
||||
`gh issue {{[ls|list]}}`
|
||||
|
||||
- View an issue in the default web browser:
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
- Create a pull request:
|
||||
|
||||
`gh pr create`
|
||||
`gh pr {{[new|create]}}`
|
||||
|
||||
- View a pull request in the default web browser:
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
- Check out a specific pull request locally:
|
||||
|
||||
`gh pr checkout {{pr_number}}`
|
||||
`gh {{[co|pr checkout]}} {{pr_number|url|branch}}`
|
||||
|
||||
- Check the status of a repository's pull requests:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user