繁體中文

新功能

Linux 上用 APT 或 RPM 裝的 gh 要認新金鑰

你在 Linux 上更新 gh,卻突然裝不起來、報簽章驗證失敗?多半是金鑰換了。GitHub CLI 的 APT 與 RPM 套件庫(Linux 下載與更新軟體的官方來源),連同個別的 RPM 套件檔,現在只用新的 PGP 金鑰簽署,指紋是 7F38BBB59D064DBCB3D84D725612B36462313325。如果你在 2026 年 4 月 8 日前從官方 APT 或 RPM 套件庫裝了 gh,又還沒更新金鑰圈(電腦裡記著哪些簽章可以信任的清單),安裝或更新就可能失敗。

照官方的 PGP 簽章金鑰輪換說明檢查、更新金鑰圈就能解決。用 Windows、macOS,或透過 Homebrew、GitHub Releases、其他套件管理器、原始碼安裝的人不受影響。

新功能

gh 登入時自動幫你複製驗證碼

用 gh auth login 登入 GitHub,或用 gh auth refresh 更新權限時,畫面會給你一組 OAuth 裝置代碼(要貼到瀏覽器授權頁、證明是你本人在登入的短碼)。以前你得自己反白、複製,再切到瀏覽器貼上;現在這兩個指令預設會直接把代碼放進剪貼簿,切過去按貼上就好。

不想要這個行為,可以用下面這行永久關掉:

gh config set clipboard disabled

某一次執行時如果你另外指定了剪貼簿選項,那一次就照你指定的來。

English

FEATURE

gh installed via APT or RPM on Linux needs the new signing key

Updating gh on Linux and suddenly getting a signature verification failure? The signing key most likely changed. GitHub CLI's APT and RPM repositories, along with individual RPM packages, are now signed only with the new PGP key, fingerprint 7F38BBB59D064DBCB3D84D725612B36462313325. If you installed gh from the official APT or RPM repositories before April 8, 2026 and haven't refreshed your keyring, installs and updates may fail.

Follow the official PGP signing key rotation guidance to check and update your keyring. Users on Windows or macOS, and anyone who installed through Homebrew, GitHub Releases, another package manager, or from source, are not affected.

FEATURE

gh now copies your login code for you

When you sign in with gh auth login or refresh permissions with gh auth refresh, the screen gives you an OAuth device code to paste into the browser's authorization page. You used to highlight it, copy it, then switch to the browser and paste. Now both commands put the code on your clipboard by default, so you just switch over and paste.

To turn this off for good, run:

gh config set clipboard disabled

If you pass an explicit clipboard option on a single run, that run follows your choice.

原始 CHANGELOG

Original changelogLinux 上用 APT 或 RPM 裝的 gh 要認新金鑰
## Linux package repository signing key rotation

GitHub CLI's APT and RPM repositories, along with individual RPM packages, are now signed only with the new PGP key (fingerprint: `7F38BBB59D064DBCB3D84D725612B36462313325`)

> [!IMPORTANT]
> Linux users who installed `gh` from the official APT or RPM repositories before April 8, 2026, and have not refreshed their keyring, may now see package installation or update failures. Follow the [PGP signing key rotation guidance](https://github.com/cli/cli/issues/13118) to check and update your keyring. Users on Windows or macOS, and users who installed `gh` through Homebrew, GitHub Releases, another package manager, or from source, are not affected.
Original changeloggh 登入時自動幫你複製驗證碼
## Copy authentication codes to the clipboard by default

`gh auth login` and `gh auth refresh` now copy OAuth device codes to the clipboard by default, saving a manual copy step during authentication.

To persistently opt out, run:

```shell
gh config set clipboard disabled
```

Explicit clipboard options still take precedence for an individual invocation.