繁體中文

新功能

在命令列直接把截圖和影片附進 issue 與 PR

回報問題時想附一張截圖,以前得先開網頁上傳。現在 gh 多了 --attach,直接把本機的圖片和影片傳上去,接進 issue、pull request 或留言的內文。

gh issue create --attach './repro.png#The error state'
gh pr comment 456 --attach ./result.mp4

內文若已經寫到那個本機路徑,gh 會把它換成上傳後的網址;沒寫到就補在最後。同一次指令要附多個檔案,就重複寫幾次這個旗標。這功能在 GitHub.com 與 GitHub Enterprise Cloud 上都能用。

新功能

`gh issue develop` 能另開工作目錄,手上的東西不用收

手邊的改動改到一半,issue 那頭又要你開一條新分支——以前得先收拾現場才能切過去。現在 gh issue develop 可以幫 issue 建好連動的分支,並且把它簽出到一個新的 Git worktree(工作樹,讓同一專案平行開多份副本的功能),你目前這份工作目錄原封不動。

gh issue develop 123 --checkout --worktree /path/to/wt-feature

English

FEATURE

Attach screenshots and videos to issues and PRs from the command line

Reporting a bug with a screenshot used to mean opening the web page to upload it first. gh now has --attach, which uploads local images and videos and puts them into the body of an issue, a pull request, or a comment.

gh issue create --attach './repro.png#The error state'
gh pr comment 456 --attach ./result.mp4

If the body already references that local path, gh swaps in the uploaded URL; otherwise the attachment is appended. Repeat the flag to attach several files in one invocation. Attachments work on GitHub.com and GitHub Enterprise Cloud.

FEATURE

`gh issue develop` can check the branch out in a separate worktree

You are halfway through a change when an issue needs a fresh branch, and until now you had to tidy up before switching over. gh issue develop can now create the linked branch for an issue and check it out in a new Git worktree, a second working copy of the same project that stands on its own, leaving your current working copy untouched.

gh issue develop 123 --checkout --worktree /path/to/wt-feature

原始 CHANGELOG

Original changelog在命令列直接把截圖和影片附進 issue 與 PR
## Attach images and videos to issues and pull requests

The repeatable `--attach` flag uploads local images and videos and adds them to issue, pull request, or comment bodies. If a body already references the local path, `gh` replaces it with the uploaded URL; otherwise it appends the attachment:

```shell
# Attach files when creating or editing an issue
gh issue create --attach './repro.png#The error state'
gh issue edit 123 --attach ./walkthrough.mp4

# Attach files when creating or editing a pull request
gh pr create --attach ./before.png
gh pr edit 456 --attach ./after.png

# Attach files to comments
gh issue comment 123 --attach ./repro.png
gh pr comment 456 --attach ./result.mp4
```

Repeat the flag to attach multiple files in a single invocation. Attachments are available on GitHub.com and GitHub Enterprise Cloud.

For more information see https://gh.io/gh-attach and https://github.blog/changelog/2026-09-01-github-cli-media-in-issues-pull-requests-and-comments/
Original changelog`gh issue develop` 能另開工作目錄,手上的東西不用收
## Worktree support extended to `gh issue develop` 

`gh issue develop` can now create a linked branch and check it out in a new Git worktree, leaving your current working copy unchanged:

```shell
# Create a linked branch for an issue and check it out in a worktree
gh issue develop 123 --checkout --worktree /path/to/wt-feature
```