设计文档在 rebase 后灰飞烟灭,git worktree 分支为其提供安全庇护

rebase 一敲,文档灰飞烟灭——用 git worktree 拯救设计文档

TL;DR: git rebase / checkout 会静默删除 .gitignore 中的未追踪文件,且无法恢复;git stash -u 不会 stash git-ignored 的文件。解决方案是用 git worktree 创建 local-assets 分支,把设计文档放在被 git 追踪的安全空间里。三条命令搞定日常:dp-save.sh 保存、--prune 清理、--restore 恢复。多个项目实测引入后文档丢失归零。完整脚本见 alexwwang/design-doc-worktree。 ...

2026-05-08 · 9 分钟 · Alex Wang