用 git 踩了个坑
資深大佬 : clrss 2
事件顺序
- 添加文件 A — commit1
- 一般操作 — commit2~9
git rm --cached A并把 A 添加到 gitignore — commit10git rebase -i commit2. 保持 commit10 不变- 回放 commit10 时, 文件 A 就丢了…
大佬有話說 (8)
事件顺序
git rm --cached A 并把 A 添加到 gitignore — commit10git rebase -i commit2. 保持 commit10 不变你的期待是 apply 后 A 留在 worktree? 可是 commit 一级不保留这个信息
复现步骤总结错了.
实际上是
git rm A
mv /some/other/file A