【问题标题】:Git: ability to stage patchGit:阶段补丁的能力
【发布时间】:2012-01-25 04:04:29
【问题描述】:

来自Git: ability to stage a certain file content without touching the working tree的跟进:

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

【问题讨论】:

  • 我不清楚你想要什么。你的意思是你想要修改索引而不是工作树?最终目标是什么?

标签: git stage


【解决方案1】:

你想要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.

【讨论】:

    猜你喜欢
    • 2015-05-21
    • 2012-09-05
    • 2018-03-18
    • 2011-06-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-30
    • 2017-07-12
    相关资源
    最近更新 更多