关于 .git/HEAD 的 repo:错误:清单丢失或不可读——请运行 init

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26091404/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 10:26:33  来源:igfitidea点击:

repo about .git/HEAD: error: manifest missing or unreadable -- please run init

androidgit

提问by Searene

I was downloading android 4.4 source code using repo(in ubuntu). Last time I killed repo process by pressing the key combination: Ctrl+Z, and when I started it this time by using the command: "repo init" and "repo sync", I got the following errors:

我正在使用 repo(在 ubuntu 中)下载 android 4.4 源代码。上次我按组合键 Ctrl+Z 终止了 repo 进程,这次当我使用命令“repo init”和“repo sync”启动它时,出现以下错误:

error: in sync: [Errno 2] No such file or directory: u'/home/ubuntu/workspace/packages/apps/VoiceDialer/.git/HEAD' error: manifest missing or unreadable -- please run init

错误:在sync:[Errno 2] 没有这样的文件或目录:u'/home/ubuntu/workspace/packages/apps/VoiceDialer/.git/HEAD' 错误:清单丢失或不可读——请运行 init

I've tried "run init", which displays no errors. But the problem remains after running "repo init". What should I do? Is there any way to tell repo to reproduce the ./git/HEAD file?

我试过“run init”,它没有显示任何错误。但是运行“repo init”后问题仍然存在。我该怎么办?有没有办法告诉 repo 重现 ./git/HEAD 文件?

回答by Searene

I solved the problem by deleting the VoiceDialer folder, then running "repo init" and "repo sync". With the .git folder in it, it may not "repo init" successfully.

我通过删除 VoiceDialer 文件夹解决了这个问题,然后运行“repo init”和“repo sync”。使用其中的 .git 文件夹,它可能无法成功“repo init”。

回答by cnbleu

I also get the problem. Here are the steps: 1. delete the folder 2. 'repo sync' the folder again.

我也明白了这个问题。步骤如下: 1. 删除文件夹 2. 再次“repo sync”文件夹。

回答by Tom

All the answers involved deleting the whole directory. While this works, it seems like an overkill. The same result can be achieved by deleting the .repo dir that was created when running repo init at the location it was ran in.

所有答案都涉及删除整个目录。虽然这有效,但似乎有点矫枉过正。通过删除在运行 repo init 时创建的 .repo 目录可以实现相同的结果。

That prevents re-downloading the whole remote repo again.

这可以防止再次重新下载整个远程存储库。

Note: If there is no such dir at the current location, it may be in one of the parent directories.

注意:如果当前位置没有这样的目录,它可能在父目录之一中。

回答by solly989

I solved this by going to /usr/bin/repo and changing the manifest pointer from 'manifest' to 'manifest.git'

我通过转到 /usr/bin/repo 并将清单指针从 'manifest' 更改为 'manifest.git' 解决了这个问题

Using an older version of git, 2.14 that's 3rd party for Centos 6.6

使用旧版本的 git,2.14 是 Centos 6.6 的第 3 方

回答by Dae

Error is usually solved by starting your repo init from scratch. This includes deleting the folder it is downloading to. You will need to remake the directory that you deleted with

错误通常是通过从头开始启动 repo init 来解决的。这包括删除它正在下载到的文件夹。您将需要重新制作您删除的目录

mkdir -p ~/mydirectory

mkdir -p ~/mydirectory

at which point you will be ready to reinitialize the repo download from scratch.

此时,您将准备好从头开始重新初始化 repo 下载。

If you are initializing a master repo for a build you will need to start from scratch, otherwise you will keep getting these errors.

如果您正在为构建初始化主存储库,则需要从头开始,否则您将不断收到这些错误。