如何获得一个可读的.git / index转储? [英] How to get a human-readable dump of .git/index?
问题描述
短版
如何获得 .git / index的合理详细的,人类可读的转储
?
我有两个索引文件, myrepo / .git / index
和 myrepo-copy / .git / index 根据
diff
(二进制文件...不同)不同。
我想知道更多关于这两个索引文件有何不同的细节。
当然,我可以查看二进制内容的差异, m感兴趣的东西更直接有意义。
因此,我正在寻找一种方法来获得这两个索引文件的可读转储,我可以与 diff
。
b
$ b
diff <(GIT_INDEX_FILE = / path / to / index1 git ls-files --stage)<(GIT_INDEX_FILE = / path / to / index2混帐ls-files --stage)
正如您已经注意到的,您可以添加 - debug
选项可以获取时间戳和其他内容的信息......
short version
How can I get a reasonably detailed, human-readable dump of .git/index
?
tl;dr version
I have two index files, myrepo/.git/index
and myrepo-copy/.git/index
that are different according to diff
("Binary files ... differ").
I'd like to know more details on how the two index files differ.
Of course, I could look at the differences in the binary content, but I'm interested in something more immediately meaningful.
Therefore I'm looking for a way to get human-readable dumps of these two index files that I can compare with diff
.
I would suggest something along these lines:
diff <(GIT_INDEX_FILE=/path/to/index1 git ls-files --stage) <(GIT_INDEX_FILE=/path/to/index2 git ls-files --stage)
As you've already noted, you can add the --debug
option to get info on timestamps and other stuff as well...
这篇关于如何获得一个可读的.git / index转储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!