Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Git的后续行动:能够在不触及工作树的情况下暂存某个文件内容:
我想通过暂存补丁(针对 HEAD)来修改一个(文本)文件的索引,而无需更改工作树文件状态。这可能吗?
你要git apply --cached
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.