致命的:git-write-tree:错误构建树 [英] fatal: git-write-tree: error building trees

查看:6182
本文介绍了致命的:git-write-tree:错误构建树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从一个共享的git仓库中做了一个 git pull ,但是我尝试了一个 git revert 。现在情况如下:

$ $ $ $ g $ st
Source / MediaStorageAndFileFormat / gdcmImageCodec.cxx:需要合并
Source / MediaStorageAndFileFormat / gdcmJPEGLSCodec.cxx:需要合并
Source / MediaStorageAndFileFormat / gdcmPNMCodec.cxx:需要合并
测试/ Source / DataStructureAndEncodingDefinition / Cxx / TestDS.cxx:需要合并
Utilities / socketxx /socket++/sockstream.cpp:需要合并
Source / MediaStorageAndFileFormat / gdcmImageCodec.cxx:需要合并
Source / MediaStorageAndFileFormat / gdcmJPEGLSCodec.cxx:需要合并
Source / MediaStorageAndFileFormat / gdcmPNMCodec.cxx:needs合并
测试/ Source / DataStructureAndEncodingDefinition / Cxx / TestDS.cxx:需要合并
Utilities / socketxx / socket ++ / sockstream.cpp:需要合并
Source / MediaStorageAndFileFormat / gdcmImageCodec.cxx:未合并(2aafac967c35fa4e77c3086b83a3c102939ad168 )
Source / MediaStorageAndFileFormat / gdcmImageCodec.cxx:未合并(78cc95e8bae85bf8345a7793676e878e83df167b)
Sou RCE / MediaStorageAndFileFormat / gdcmImageCodec.cxx:未合并(2524db713fbde0d7ebd86bfe2afc4b4d7d48db33)
来源/ MediaStorageAndFileFormat / gdcmJPEGLSCodec.cxx:未合并(4bb4ba78973091eaa854b03c6ce24e8f4af9e7cc)
来源/ MediaStorageAndFileFormat / gdcmJPEGLSCodec.cxx:未合并(ad0982b8b8b4c4fef23e69bbb639ca6d0cd98dd8)
来源/ MediaStorageAndFileFormat / gdcmJPEGLSCodec.cxx:未合并(4868371b7218c6e007fb6c582ad4ab226167a80a)
来源/ MediaStorageAndFileFormat / gdcmPNMCodec.cxx:未合并(f7a1b386b5b13b8fa8b6a31ce1258d2d5e5b13c5)
来源/ MediaStorageAndFileFormat / gdcmPNMCodec.cxx:未合并(6ce299c416fbb3bb60e11ef1e54962ffd3449a4c)
来源/ MediaStorageAndFileFormat / gdcmPNMCodec.cxx:unmerged(75c8043a60a56a1130a34cdbd91d130bc9343c1c)
测试/ Source / DataStructureAndEncodingDefinition / Cxx / TestDS.cxx:未合并(79c2843f2649ea9c87fa57662dafd899a5fa39ee)
...
致命错误:git-write-tree:错误构建树
无法保存当前索引状态

有没有办法重置所有这些?

谢谢

解决方案

使用:



git reset --mixed



而不是 git reset --hard 。你不会失去任何改变。


I did a git pull from a shared git repository, but something went really wrong, after I tried a git revert. Here is the situation now:

$ git stash
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: needs merge
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: needs merge
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: needs merge
Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestDS.cxx: needs merge
Utilities/socketxx/socket++/sockstream.cpp: needs merge
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: needs merge
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: needs merge
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: needs merge
Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestDS.cxx: needs merge
Utilities/socketxx/socket++/sockstream.cpp: needs merge
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: unmerged (2aafac967c35fa4e77c3086b83a3c102939ad168)
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: unmerged (78cc95e8bae85bf8345a7793676e878e83df167b)
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: unmerged (2524db713fbde0d7ebd86bfe2afc4b4d7d48db33)
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: unmerged (4bb4ba78973091eaa854b03c6ce24e8f4af9e7cc)
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: unmerged (ad0982b8b8b4c4fef23e69bbb639ca6d0cd98dd8)
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: unmerged (4868371b7218c6e007fb6c582ad4ab226167a80a)
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: unmerged (f7a1b386b5b13b8fa8b6a31ce1258d2d5e5b13c5)
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: unmerged (6ce299c416fbb3bb60e11ef1e54962ffd3449a4c)
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: unmerged (75c8043a60a56a1130a34cdbd91d130bc9343c1c)
Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestDS.cxx: unmerged (79c2843f2649ea9c87fa57662dafd899a5fa39ee)
...
fatal: git-write-tree: error building trees
Cannot save the current index state

Is there a way to reset all that ?

Thanks

解决方案

Use:

git reset --mixed

instead of git reset --hard. You will not lose any changes.

这篇关于致命的:git-write-tree:错误构建树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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