3

Git的后续行动:能够在不触及工作树的情况下暂存某个文件内容

我想通过暂存补丁(针对 HEAD)来修改一个(文本)文件的索引,而无需更改工作树文件状态。这可能吗?

4

1 回答 1

4

你要git apply --cached

从手册页:

   --cached
       Apply a patch without touching the working tree. Instead take the cached data, apply the patch, and store
       the result in the index without using the working tree. This implies --index.
于 2011-12-21T10:32:37.437 回答