致命:git-write-tree:构建树时出错
我正在尝试使用 git-svn 将大型 subversion 存储库导入 git (这样我就可以在 git 中工作,但仍然不时地提交 subversion)。导入超过 4000 个修订后,每当我运行 git svn fetch 或 git svn rebase 时,我都会收到以下错误,但我无法摆脱该错误:
$ git svn fetch
error: invalid object 100644 1f2....742 for 'src/path/.../file.cs'
fatal: git-write-tree: error building trees
write-tree: command returned error: 128
到目前为止我已经尝试过:
- git fsck --full 没有报告任何内容, git fsck --unreachable 或 git fsck --no- 也没有报告任何内容reflog
git gc --aggressive
无助于- 将单个包文件移走,并且使用
git unpack-objects
重新导入它也无济于事 git svn Reset -rXY
与 XY 比最新导入的版本低一点似乎也没有帮助,手动从reflog
删除最新条目到 XY 也没有帮助。- 重新启动。听起来很傻,但我在导入第一个 ~4000 修订版时确实观察到一些奇怪的问题,就好像某些东西泄漏了大量内核资源(最有可能在 Windows 子系统中),可能与 msys/mingw (或 avira 病毒扫描程序,我禁用它进行测试)。
我也不知道错误128到底代表什么。有什么想法吗?提前致谢!
可能与此问题相关这也与错误 128 相关,但具有不同的错误消息,并且没有解决方案。
msysgit 版本 1.6.4.msysgit.0
在 xp sp3 上带有 bash
I'm trying to import a large subversion repository into git using git-svn (so that I can work in git but still dcommit to subversion from time to time). After importing more than 4000 revisions I'm now getting the following error whenever I run git svn fetch
or git svn rebase
, which I don't manage to get rid of:
$ git svn fetch
error: invalid object 100644 1f2....742 for 'src/path/.../file.cs'
fatal: git-write-tree: error building trees
write-tree: command returned error: 128
What I've tried so far:
git fsck --full
doesn't report anything, neither doesgit fsck --unreachable
orgit fsck --no-reflog
git gc --aggressive
doesn't help- moving the single pack file away and reimporting it with
git unpack-objects
doesn't help git svn reset -rXY
with XY a bit lower than the latest imported revsion doesn't seem to help either, neither does manually removing the latest entries from thereflog
up to XY.- reboot. Sounds silly, but I did observe some weird issues while importing the first ~4000 revision, as if something was leaking a lot of kernel resources (most likely in windows subsystem), might be related to msys/mingw (or the avira virus scanner, which I disabled for testing).
I also didn't find out what error 128 really stands for. Any ideas? Thanks in advance!
Might be related to this question which is about error 128 as well but with different error messages, and without a solution.
msysgit version 1.6.4.msysgit.0
with bash on xp sp3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
git svn gc
(之前可能是
git gc
和git prune
)git svn gc
(possibly
git gc
andgit prune
before)简短的回答:尝试解决任何合并冲突,提交它们,然后它们再次获取/拉取。
更长的解释:
我猜你已经解决了这个问题,因为它是很久以前发布的。我写这篇文章是因为 Google 对 StackOverflow 文章的排名足够高,其他遇到此问题的人如果遇到此错误,很可能会访问此页面。
我在尝试执行“git stash”时遇到了类似的错误,结果发现问题是拉取后发生了合并冲突。我还没有解决&提交了冲突,这使得存储库处于阻止我拉取/合并/等的状态...
如果您确保没有任何阻塞文件,请重试。
祝你好运!
Short answer: Try resolving any merge conflicts, committing them, and they fetch/pull again.
Longer explanation:
I'm guessing you resolved this issue, since it was posted so long ago. I'm writing this since Google's ranking of StackOverflow articles is high enough that other people with this problem would be very likely to visit this page if they had this error.
I encountered a similar error when trying to do a "git stash", what turned out to be the problem was that a merge conflict had occurred after a pull. I had not resolved & committed the conflict, and this left the repository in a state that prevented me from pulling/merging/etc...
If you make sure you don't have any blocking files, try again.
Good luck!