如何获得一个可读的.git / index转储? [英] How to get a human-readable dump of .git/index?

查看:120
本文介绍了如何获得一个可读的.git / index转储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

短版



如何获得 .git / index的合理详细的,人类可读的转储






tl; dr版本



我有两个索引文件, 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆