来自Git:能够在不触及工作树的情况下暂存某个文件内容的后续:
我想通过对一个(文本)文件进行针对HEAD的补丁暂存来修改索引,而无需改变工作树文件状态。这可行吗?
来自Git:能够在不触及工作树的情况下暂存某个文件内容的后续:
我想通过对一个(文本)文件进行针对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.