锐英源软件
第一信赖

精通

英语

开源

擅长

开发

培训

胸怀四海 

第一信赖

当前位置:锐英源 / 开源技术 / 软件工程技术社区和软件工程工具社区 / Fatal:reference is not a tree
服务方向
软件开发
办公财务MIS
股票
设备监控
网页信息采集及控制
多媒体
软件开发培训
Java 安卓移动开发
Java Web开发
HTML5培训
iOS培训
网站前端开发
VC++
C++游戏开发培训
C#软件
C语言(Linux)
ASP.NET网站开发(C#)
C#软件+ASP.NET网站
SOCKET网络通信开发
COMOLE和ActiveX开发
C++(Linux)
汇编和破解
驱动开发
SkinMagicVC++换肤
流媒体开发
MicroStation二次开发
计算机英语翻译
联系方式
固话:0371-63888850
手机:138-0381-0136
Q Q:396806883
微信:ryysoft

锐英源精品开源,禁止转载和任何形式的非法内容使用,违者必究


Fatal:reference is not a tree

It all started when I decided to figure out why the project I'm working on weighs so much. I've run the following script:这一切都始于我决定弄清楚为什么我正在研究的项目如此重要。我运行以下脚本:

git rev-list --objects --all \  
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \  
| sed -n 's/^blob //p' \  
| sort --numeric-sort --key=2 \  
| cut -c 1-12,41- \  
| $(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest  

and figured out which commits have the heaviest files. Next, I would like to see who is the author of those commits and when trying to run something like:

并找出哪些提交具有最重的文件。接下来,我想看看谁是这些提交的作者,以及何时尝试运行以下内容:

git show --stat COMMIT_HASH  

I get a pile of gobbledegook and when I try rolling back to the commit, I get the abovementioned error.

So my question is: how do I find the author of the commit?我收到一堆gobbledegook,当我尝试回滚到提交时,出现上述错误。

所以我的问题是:我如何找到提交的作者?

Your git show command should work. Either the hash is not valid or the commit object has been corrupted in some way.

Updated: Your script returns object hashes, so probably the reference for that object is invalid somehow.

You wouldn't be able to get the author reference from there anyhow.

This might help, it will list all the commits where the object whose hash you provide has been modified:

您的git show命令应该起作用。哈希无效或提交对象已以某种方式损坏。

更新: 脚本返回对象哈希,因此该对象的引用可能在某种程度上无效。

无论如何,您将无法从那里获得作者参考。

这可能会有所帮助,它将列出所有修改了您提供的哈希值的对象的提交:

git log --find-object=OBJECT_HASH

答2

well I took the hash corresponding to the commit with the heaviest file, the hash was yielded by the bash script. But in that case , is there a simple way to remove the object? – Albert Jan 16 at 21:03好吧,我拿了对应于具有最重文件的提交的哈希,哈希由bash脚本生成。但是在那种情况下,是否有一种简单的方法来删除对象?
but before doing that I would actually like to find out the author of the commit. – Albert Jan 16 at 21:06但在此之前,我实际上想找出提交的作者
ah seems like the hash yielded by the script is not what I thought it was... – Albert Jan 16 at 21:13嗯,似乎脚本产生的哈希值不是我想的那样
I have to update my answer. I ran your command and noticed that it returns object hashes, not commit hashes. – Nick Toumpelis Jan 16 at 21:13我必须更新我的答案。我运行了您的命令,发现它返回对象哈希,而不是提交哈希。

友情链接
版权所有 Copyright(c)2004-2021 锐英源软件
公司注册号:410105000449586 豫ICP备08007559号 最佳分辨率 1024*768
地址:郑州大学北校区院(文化路97号院)内劳动服务器公司办公楼一层