环境

git version 1.9.1
Gerrit Code Review (2.11.3)
  • 1
  • 2

现象

修改后调用 git review可以提交到Gerrit上,然后只要一用 git commit --amend修改 Commit Message再提交,就会出现此错误;而如果不修改Commit Message,而只是修改增加文件,那么可以用 --amend提交再 git review

error: unpack failed: error Missing tree 8d89499daadf6417347218b630b5cae57e7fa27c
fatal: Unpack error, check server log
To ssh://user1@review.zjc.com:29418/test-project1.git
! [remote rejected] HEAD -> refs/publish/master (n/a (unpacker error))
error: failed to push some refs to 'ssh://user1@review.zjc.com:29418/test-project1.git'
  • 1
  • 2
  • 3
  • 4
  • 5

解决方案

经过多方查资料,是提交时的 thin push 的问题,默认是开着的,要把它关掉

有人说

  • 在工程的 .gitreview 下的 Gerrit节点下增加 disablethinpush=true
  • 在 /etc/git-review/git-review.conf 中添加 disablethinpush=true
  • 用 git push --no-thin ...来解决,因为这是一个BUG
  • 涉及到库更改时候有未关闭的的patch,更新gerrit的数据库

好吧,我承认在Git使用上我是菜鸟,我只是用 git review来提交而已。捣鼓了半天上面的N种列出来没列出来的解决方案,都失败

好吧,说出来我碰巧得到的一个这种方案

执行命令git review --no-thin :失败 
无意间看到 git review -h 有个命令行参数 -n 
执行命令git review -n :

Please use the following command to send your commits to review: 
git push gerrit HEAD:refs/publish/master

执行 git push gerrit HEAD:refs/publish/master : 还是那个错误

执行 git push --no-thin gerrit HEAD:refs/publish/master

成功了!!!!

好吧,我笨 && 牛人的世界我不懂

结论

加一个结论吧,啰嗦一大堆,其实就2句话是关键 
执行 git review,如果出现错误就执行 git push --no-thin gerrit HEAD:refs/publish/master

参考

https://libraries.io/github/savoirfairelinux/git-review 
https://bugs.launchpad.net/git-review/+bug/1332549 
http://www.cnblogs.com/qingliuyu/p/4510233.html

Git review :error: unpack failed: error Missing tree的更多相关文章

  1. error: unpack failed: error Missing tree

    最近新建一个仓库,push时遇到如下问题,试了好多方法,最后在stackoverflow上找到解决办法了,可是在开始时就试过这方法,但不成.至于为嘛出现的这种错误,还是不明白原因. git.exe p ...

  2. gerrit代码审核工具之“error unpack failed error Missing unknown”错误解决思路

    使用gerrit代码审核工具时遇到error: unpack failed: error Missing unknown d6d7c89bd1d77f44c5c8e99437aaffbfc0684e7 ...

  3. gerrit error: unpack failed: error Permission denied

    gerrit服务器迁移后,clone和pull代码到本地,都没问题. 但是,push时,报错: 查看了下git版本库存储目录,发现git下版本库镜像文件owner都是root.因为之前安装的gerri ...

  4. GitBlit中出现 error: remote unpack failed: error Missing tree

    clu@WASYGSHA01-1020 MINGW64 /d/ChuckLu/Git/Edenred/LISA_5.0.0.0 (local)$ git push origin preaction:p ...

  5. 配置web pack loader 报错:Module build failed: Error: The node API for `babel` has been moved to `babel-core`.

    报错如下 Module build failed: Error: The node API for `babel` has been moved to `babel-core`. 在我配置loader ...

  6. 百度人脸识别集成错误:Build command failed. Error while executing process F:\dev\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments

    大概是这么个错误 Build command failed. Error while executing process F:\dev\Android\Sdk\cmake\3.6.4111459\bi ...

  7. 【Problem】前端项目运行:Module build failed:Error Node Sass does not yet support my current environmen

    我在运行renren-fast-vue前端项目时,安装完依赖cnpm install 启动服务npm run dev 出现问题. Module build failed: Error: Node Sa ...

  8. npm run dev 启动错误:Module build failed: Error: No PostCSS Config found in:xxxxxxxxxxxxxx

    解决办法:在根目录新建postcss.config.js module.exports = { plugins: { 'autoprefixer': {browsers: 'last 5 versio ...

  9. 移动vue项目,启动错误:Module build failed: Error: No PostCSS Config found in:

    解决办法:在根目录新建postcss.config.js module.exports = { plugins: { 'autoprefixer': {browsers: 'last 5 versio ...

随机推荐

  1. 2012Noip提高组Day2 T3 疫情控制

    题目描述 H 国有 n 个城市,这 n 个城市用 n-1 条双向道路相互连通构成一棵树,1 号城市是首都,也是树中的根节点. H 国的首都爆发了一种危害性极高的传染病.当局为了控制疫情,不让疫情扩散到 ...

  2. 有关InitialContext()的困惑 <转>

    Context initial = new InitialContext();Object objref = initial.lookup("java:comp/env/ejb/Simple ...

  3. Mac - 如何在windows下打开 pages

    1.iCloud 苹果邮箱网页版打开(www.icloud.com) 2.在pages编辑完后,导出word格式.便能继续编辑.修改文档内容,有小部分字体.设计会在导出word格式后发生改变. 3.导 ...

  4. AIX系统崩溃后oracle数据库的恢复方法

    首先要确保数据库实例的完整性,包括控制文件,日志文件,表空间(系统表空间.用户表空间等). 新建同名数据库实例(表空间.用户等不需要). Sql>shutdown immediate关闭数据库 ...

  5. MySQL监控、性能分析——工具篇(转载)

    MySQL越来越被更多企业接受,随着企业发展,MySQL存储数据日益膨胀,MySQL的性能分析.监控预警.容量扩展议题越来越多.“工欲善其事,必先利其器”,那么我们如何在进行MySQL性能分析.监控预 ...

  6. VirtualBox Guest Additions installation

    在使用VirtualBox为CentOS安装增强功能时,输出是: 文本: Verifying archive integrity... All good. Uncompressing VirtualB ...

  7. JS中手动触发事件的方法

    如果大家将一张网页看成一个form的话,大致上就成了一个web form的模型.在win form 下要想手动触发某一个对象的事件是很简单的,只要发送一条消息即可达成.(PostMessage) 但是 ...

  8. python之轮询、长轮询、websocket

    轮询 ajax轮询 ,ajax轮询 的原理非常简单,让浏览器隔个几秒就发送一次请求,询问服务器是否有新信息. 1.后端代码 from flask import Flask,render_templat ...

  9. Openstack(七)keystone

    官方安装文档:https://docs.openstack.org/ocata/zh_CN/install-guide-rdo/index.html 7.1 keystone简介 Keystone 中 ...

  10. SpringBoot开启缓存注解

    https://blog.csdn.net/sanjay_f/article/details/47372967 https://www.cnblogs.com/lic309/p/4072848.htm ...