我手边没有特定的问题,但过去遇到过一些我不小心炸掉我的索引的情况,希望我可以返回给定文件的前一个状态,该文件在某个时刻被编入索引。索引是否有reflog?
一些示例情况是:
$ git add <file>
# find out that I already had an indexed version of <file>,
# and that for some reason I shouldn't have added the extra modifications
$ git stash pop
# find out afterwards that I have a mix of "the index I had"
# and "the index in the stash"
$ git stash
# with an active index, which is now mixed with the state of the working tree
$ git reset <typo>
# accidentally resetting the wrong file, or the whole directory
人们可以诉诸通过git fsck --full --unreachable --no-reflog
挖掘(如建议here),我想知道是否有这样做更方便的方式。
问:
是否有某种引用日志为指数?
创建日期的窍门是一个不错的主意。谢谢。 – LeGEC
为了测试的目的,我试图查找由'fsck --unreachable'返回的所有'.git/objects/ab/cdef ...'blob。一些晃来晃去的斑点不在那里,这可能意味着它们被存储在包文件中。你知道一个快速的方法来找到blob所属的包文件吗? – LeGEC
我正在寻找文件的修改日期。您是否还有其他技巧可以找到blob的修改日期? – LeGEC