【发布时间】:2012-01-25 04:04:29
【问题描述】:
来自Git: ability to stage a certain file content without touching the working tree的跟进:
我想修改一个(文本)文件的索引通过暂存补丁(针对 HEAD),而无需更改工作树文件状态。这可能吗?
【问题讨论】:
-
我不清楚你想要什么。你的意思是你想要修改索引而不是工作树?最终目标是什么?
来自Git: ability to stage a certain file content without touching the working tree的跟进:
我想修改一个(文本)文件的索引通过暂存补丁(针对 HEAD),而无需更改工作树文件状态。这可能吗?
【问题讨论】:
你想要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.
【讨论】: