【Repo】repo sync:error.GitError: cannot initialize work tree

1.Error

Fetching projects: 100% (725/725), done.
Checking out files: 100% (4605/4605), done.out files:  41% (1902/4605)
Checking out files: 100% (4371/4371), done.out files:   2% (89/4371)
Checking out files: 100% (48/48), done.king out files:  35% (17/48)
Checking out files: 100% (13649/13649), done.ut files:  43% (5897/13649)
Checking out files: 100% (9868/9868), done. out files:  33% (3318/9868)
Checking out files: 100% (21681/21681), done.ut files:  14% (3196/21681)
Checking out files: 100% (5902/5902), done. out files:  40% (2407/5902)
Checking out files: 100% (278/278), done.ng out files:  48% (134/278)
Checking out files: 100% (677/677), done.ng out files:  36% (247/677)
Checking out files: 100% (5491/5491), done. out files:  37% (2055/5491)
Checking out files: 100% (43496/43496), done.ut files:   6% (2893/43496)
Checking out files: 100% (16115/16115), done.
Checking out files: 100% (2626/2626), done. out files:  37% (985/2626)
Checking out files: 100% (3081/3081), done. out files:  45% (1389/3081)
Checking out files: 100% (33649/33649), done.ut files:   1% (401/33649)
Checking out files: 100% (2822/2822), done. out files:  25% (725/2822)
Checking out files: 100% (60891/60891), done.ut files:  12% (7317/60891)
Checking out files: 100% (4780/4780), done. out files:  22% (1077/4780)
Checking out files: 100% (3472/3472), done. out files:  44% (1542/3472)
fatal: failed to unpack tree object HEAD
Traceback (most recent call last):
  File "/home/lenovosh/Qualcomm/SourceCode/mirror/SDM845_r00110.1/Android/.repo/repo/main.py", line 500, in <module>
    _Main(sys.argv[1:])
  File "/home/lenovosh/Qualcomm/SourceCode/mirror/SDM845_r00110.1/Android/.repo/repo/main.py", line 476, in _Main
    result = repo._Run(argv) or 0
  File "/home/lenovosh/Qualcomm/SourceCode/mirror/SDM845_r00110.1/Android/.repo/repo/main.py", line 155, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/lenovosh/Qualcomm/SourceCode/mirror/SDM845_r00110.1/Android/.repo/repo/subcmds/sync.py", line 675, in Execute
    project.Sync_LocalHalf(syncbuf)
  File "/home/lenovosh/Qualcomm/SourceCode/mirror/SDM845_r00110.1/Android/.repo/repo/project.py", line 1170, in Sync_LocalHalf
    self._InitWorkTree()
  File "/home/lenovosh/Qualcomm/SourceCode/mirror/SDM845_r00110.1/Android/.repo/repo/project.py", line 2230, in _InitWorkTree
    raise GitError("cannot initialize work tree")
error.GitError: cannot initialize work tree

2.Solution
①repo --trace sync -cdf将repo的所有动作详细输出:

repo --trace sync -cdf
: unpickle /home/lenovosh/Qualcomm/SourceCode/mirror/SDM845_r00110.1/Android/.repo/manifests.git/config
: unpickle /home/lenovosh/.gitconfig
: unpickle /home/lenovosh/Qualcomm/SourceCode/mirror/SDM845_r00110.1/Android/.repo/repo/.git/config
: export GIT_DIR=/home/lenovosh/Qualcomm/SourceCode/mirror/SDM845_r00110.1/Android/.repo/manifests.git
: git fetch origin --tags +refs/heads/release:refs/remotes/origin/release
: load refs /home/lenovosh/Qualcomm/SourceCode/mirror/SDM845_r00110.1/Android/.repo/manifests.git
: scan refs /home/lenovosh/Qualcomm/SourceCode/mirror/SDM845_r00110.1/Android/.repo/manifests.git
Fetching project platform/packages/apps/Car/Cluster
: unpickle /home/lenovosh/Qualcomm/SourceCode/mirror/SDM845_r00110.1/Android/.repo/projects/packages/apps/Car/Cluster.git/config

: export GIT_DIR=/home/lenovosh/Qualcomm/SourceCode/mirror/SDM845_r00110.1/Android/.repo/projects/packages/apps/Car/Cluster.git
: git rev-parse --verify fa927c0de153e238013497a16f64007bfb89a780^0 1>| 2>|
: load refs /home/lenovosh/Qualcomm/SourceCode/mirror/SDM845_r00110.1/Android/.repo/projects/packages/apps/Car/Cluster.git
: scan refs /home/lenovosh/Qualcomm/SourceCode/mirror/SDM845_r00110.1/Android/.repo/projects/packages/apps/Car/Cluster.git
Fetching project platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8
: unpickle /home/lenovosh/Qualcomm/SourceCode/mirror/SDM845_r00110.1/Android/.repo/projects/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8.git/config

: export GIT_DIR=/home/lenovosh/Qualcomm/SourceCode/mirror/SDM845_r00110.1/Android/.repo/projects/prebuilts/android-emulator.git
: git rev-parse --verify cbdfa5df4f2105148cc2fa6ce4ddf3bc1695b488^0 1>| 2>|
: git rev-parse --verify cbdfa5df4f2105148cc2fa6ce4ddf3bc1695b488^0 1>| 2>|
: git fetch caf --tags +refs/heads/ks-aosp.lnx.2.0.r1-rel:refs/remotes/caf/ks-aosp.lnx.2.0.r1-rel
remote: Counting objects: 8539, done.
remote: Compressing objects: 100% (1256/1256), done.
Receiving objects:  58% (4966/8539), 94.70 MiB | 12.00 KiB/s    

error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
: git rev-parse --verify cbdfa5df4f2105148cc2fa6ce4ddf3bc1695b488^0 1>| 2>|
: git fetch caf --tags +refs/heads/*:refs/remotes/caf/*
remote: Counting objects: 8552, done.
remote: Compressing objects: 100% (1269/1269), done.
error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.
fatal: The remote end hung up unexpectedly
fatal: protocol error: bad pack header
: git fetch caf --tags +refs/heads/*:refs/remotes/caf/*
remote: Counting objects: 8553, done.
remote: Compressing objects: 100% (1270/1270), done.

②因此,将prebuilts/android-emulator这个文件夹删除,在.repo/projects下删除.repo/projects/prebuilts/android-emulator.git目录,以及.repo/project-objects/prebuilts/android-emulator.git目录
③最后重新repo sync即可

原文地址:https://www.cnblogs.com/wucaiyun1/p/11671235.html

时间: 2024-11-05 19:47:50

【Repo】repo sync:error.GitError: cannot initialize work tree的相关文章

【Nginx】配置、error日志和请求上下文

处理http配置项可以分为下面4个步骤: 1)创建数据结构用于存储配置项对应的参数 2)设定配置项在nginx.conf中出现时的限制条件与回调方法 3)实现第2步中的回调方法,或者使用Nginx框架预设的14个回调方法 4)合并不同级别的配置块中出现的同名配置项 一.分配用于保存配置参数的数据结构 创建结构体来存储配置项的参数值,使用create_main_conf,create_srv_conf.create_loc_conf这三个回调方法把我们分配的用于保存配置项的结构体传递给http框架

【转】repo sync同步Android 源代码下载到99%出错

原文网址:http://blog.csdn.net/mr_president/article/details/7693707 根据Google官网上的方法在我们实验室搭建了一个本地的Android代码镜像服务器, 今天一个师弟在服务器上利用repo sync下载源代码下到99%的时候,出现了下面的问题: $ repo sync fatal: Not a git repository: '/home/andev/android/.repo/projects/bionic.git'Fetching

【转】repo介绍

Android 使用 Git 作为代码管理工具,开发了 Gerrit 进行代码审核以便更好的对代码进行集中式管理,还开发了 Repo 命令行工具,对 Git 部分命令封装,将百多个 Git 库有效的进行组织. 1.1    清单库文件介绍 一个清单库可以包含多个清单文件和多个分支,每个清单文件和分支都有对应的版本.清单文件以xml格式组织的.举个例子: Ø         remote元素,定义了名为korg的远程版本库,其库的基址为git://172.16.1.31/ Ø         de

【转】repo 的一些用法和理解-不错

原文网址:http://blog.csdn.net/yasin_lee/article/details/5975068 repo的用法(zz) 注:repo只是google用Python脚本写的调用git的一个脚本,主要是用来下载.管理Android项目的软件仓库.(也就是说,他是用来管理给git管理的一个个仓库的) 下载 repo 的地址: http://android.git.kernel.org/repo ,可以用以下二者之一来下载 repo wget http://android.git

【MySQL】Got fatal error 1236原因和解决方法

一 前言  MySQL 的主从复制作为一项高可用特性,用于将主库的数据同步到从库,在维护主从复制数据库集群的时候,作为专职的MySQL DBA,笔者相信大多数人都会遇到"Got fatal error 1236 from master when reading data from binary log" 这类的报错/报警.本文整理了常见的几种 error 1236 报错,并给出相应的解决方法,有所不足之处,当然也希望各位读者朋友指正. 二 常见的error 1236 报错2.1 log

【题解】CF#172(Div. 1) C.Game on Tree

感觉对期望也一无所知……(:′⌒`)╮(╯﹏╰)╭ 一直在考虑怎么dp,最后看了题解——竟然是这样的???[震惊]但是看了题解之后,觉得确实很有道理…… 我们可以考虑最后答案的组成,可以分开计算不同的点对于答案的贡献(期望具有线性性).我们可以把这个染色的过程看做每一个节点均需要被染色,但只有第一个被染色的节点会消耗1点代价.这样我们就可以分别分析每个点对于答案产生贡献的概率,答案即为概率之和.而一个点会对答案产生影响的概率是多少?实际上这只与它到根的链上的节点是相关的,因为只要在染色它的祖先节

【Repo】repo mirror 加快代码下载速度

一.建立本地mirror加快代码下载速度: 安卓源码是几百个仓库组成的,代码量都是几十GB的.一个kernel都要有1个GB大小.怎么才能快速的下载 代码呢?那就是本地建个mirror.就是说你下载了好几套代码,每个代码都放在了不同的目录,这几套代码 很多都是重复的,我们把重复的共享使用一个目录,这个就是mirror.这个mirror主要是git裸仓库. 具体用法就是在repo init命令中加上这个选项–mirror就行了.初次创建需要在一个空目录下面执行命令. 一般的会把本地mirror统一

【转】[fix] Wireshark error: There are no interfaces on which a capture can be done. on Mac OS X

I got the following error message when trying to open a network interface for capture using Wireshark on Mac OS X (Wireshark 1.5.1 Intel 64 beta and 1.4.6 Intel 64 show this behaviour): There are no interfaces on which a capture can be done. To solve

【C++】LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏

错误:LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 解决方案:将 项目——项目属性——配置属性——连接器——清单文件——嵌入清单 “是”改为“否”.