Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

`gh skill update` help incorrectly promises to preserve locally added files

未關閉 適合新手
#14,647 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@rajpreetcodes 已經在處理了。

開始於 2026年10月14日。

  • #14689 來自 @rajpreetcodes —— 未關閉

評估

難度
1/5
預估耗時
1 小時以內
新手友好度
82/100
Issue 類型
文件
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
go
領域
cli, documentation

研究方向

說明文字位於 pkg/cmd/skills/update/update.go 約第 98–100 行;先閱讀其中關於 --force 和 update 的說明,再檢查 pkg/cmd/skills/update/update_test.go 約第 730–780 行的更新測試所描述的行為。更新說明文字,指出套用更新會取代已安裝目錄的內容,並說明即使 upstream 版本沒有變更,--force 也會執行此操作。

由索引模型根據 Issue 內容生成。

描述

bug gh-skill priority-3
Describe the bug

gh skill update --help says that --force refreshes locally modified skill files but “does not remove extra files added locally.” On 2.102.0, applying an update replaces all contents of the installed skill directory, deleting locally added files. This also happens during a version update without --force.

A user relying on that sentence can lose notes or scripts they added to a skill directory. The documented --force --all example describes restoring modified files without explaining that additional files are discarded.

Affected version
gh version 2.102.0 (2026-09-30)
https://github.com/cli/cli/releases/tag/v2.102.0
Steps to reproduce the behavior
dir=$(mktemp -d)
gh skill install cli/cli gh --dir "$dir"
echo notes > "$dir/gh/LOCAL-NOTES.md"
gh skill update gh --dir "$dir" --force --all
ls "$dir/gh"

A version update reproduces this without --force: install gh with --pin v2.100.0, add LOCAL-NOTES.md, then run gh skill update gh --dir "$dir" --unpin --all.

Expected vs actual behavior

Expected from the help: LOCAL-NOTES.md remains alongside the refreshed SKILL.md.

Actual: LOCAL-NOTES.md is deleted; only SKILL.md remains in this reproduction.

#13449 explicitly made stale-file removal part of an in-place update, and the update test requires a locally planted file to disappear. However, the help still promises to keep extra local files.

Please correct the help to explain that applying any update replaces the installed directory's contents with the upstream skill, discarding local modifications and additional files. The --force description should separately explain that it also applies this replacement when the upstream version has not changed.

Logs
$ gh skill update gh --dir "$dir" --force --all
1 update(s) available:
  • gh (cli/cli) a4791f98 (reinstall) [v2.102.0]

Updated gh
$ ls "$dir/gh"
SKILL.md
主要語言
Go
星號
46.7k
分支
9.2k
平均合併
3 天 19 小時
30 天內合併 PR
53

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

cli/cli 的其他 Issue

查看 cli/cli 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。