【发布时间】:2020-01-05 12:43:24
【问题描述】:
$ git init
$ git commit -m 'initial commit needed to stash' --allow-empty
$ touch test
$ git add --intent-to-add test # aka -N
$ git stash
error: Entry 'test' not uptodate. Cannot merge.
Cannot save the current worktree state
它不是未跟踪的,所以--include-untracked 没有影响。有什么方法可以存储已添加但从未提交的文件?
【问题讨论】:
-
你为什么要使用
--intent-to-add选项,你需要它吗? -
看起来像一个重复的问题,它已被stackoverflow.com/questions/14759748/…回答
-
@mnestorov 因为我打算添加文件。但还没有,所以我把它藏起来了。当然,我不能那样做……但这并不能回答问题;)
-
@DillipKumarBehera 这不是重复的,除非你可以扩展它来解释我缺少什么我不认为它回答了这个问题。
-
@OJFord 如果你
add你的文件正常,没有任何--intent然后隐藏它,而不提交,那么你应该能够隐藏一个文件而不提交它。