环境

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. java中的Iterator和Iterable 区别

    java.lang.Iterable java.util.Iterator 来自百度知道: Iterator是迭代器类,而Iterable是接口. 好多类都实现了Iterable接口,这样对象就可以调 ...

  2. MQTT的学习研究(十三) IBM MQTTV3 简单发布订阅实例

    使用IBM MQTTv3实现相关的发布订阅功能 MQTTv3的发布消息的实现: package com.etrip.mqttv3; import com.ibm.micro.client.mqttv3 ...

  3. CSS- ie6,ie7,ie8 兼容性写法,CSS hack写法

    css ie6,ie7,ie8 兼容性写法,CSS hack写法 margin-bottom:40px;       /*ff的属性*/margin-bottom:140px\9;    /* IE6 ...

  4. cursor:hand & cursor:pointer

    1.cursor:hand & cursor:pointer都是将鼠标设置为手形. 2.cursor:hand存在兼容性问题,firefox并不支持该属性值.但大部分主流浏览器支持cursor ...

  5. webpack----entry

    入口文件下对象的键值,不多说,上图: 其实app就等同于name,于是乎 dist下的index.html中引入的js,就是: <script type="text/javascrip ...

  6. 1.执行环境判断 window 或 self

    window or self ? 在 underscore 的判断所处环境的代码中,似乎我们没有看到 window 对象的引用,其实,在浏览器环境下,self 保存的就是当前 window 对象的引用 ...

  7. jhipser微服务架构介绍

    内容提要 本文涉及以下内容: 微服务架构介绍 spring cloud介绍 jhipster架构介绍 微服务架构介绍 微服务概念 微服务和SOA很相似,都是按照业务功能把系统拆分成一个一个的服务.比如 ...

  8. MySQL 5.6 my.cnf 参数说明(转)

    # 以下选项会被MySQL客户端应用读取. # 注意只有MySQL附带的客户端应用程序保证可以读取这段内容. # 如果你想你自己的MySQL应用程序获取这些值. # 需要在MySQL客户端库初始化的时 ...

  9. JS实现拖拽效果

    <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title> ...

  10. 验证url的正则

    一. '/@(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()& ...