android - repo 同步结果在 "fatal: Not a git repository: ' working_dir/.repo/projects/external/ipsec-tools.git'"

标签 android git android-source

我正在尝试下载 Android 源代码并按照 https://source.android.com/source/downloading.html 中描述的过程进行操作,包括安装 repo 脚本然后运行 ​​

$ repo init -u https://android.googlesource.com/platform/manifest
$ repo sync

获取主分支。我也曾尝试使用 -f -j1 标志来解决错误并仅使用一个核心,正如在线某处所建议的那样。在这一点上,我认为我已经非常接近下载整个东西了,但是在使用 ipsec-tools 时它总是会在最后停止。它总是给出以下输出:

    Fetching project platform/external/ipsec-tools
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     1  100     1    0     0      3      0 --:--:-- --:--:-- --:--:--     3
100 1690k  100 1690k    0     0  2307k      0 --:--:-- --:--:-- --:--:-- 2307k
fatal: Not a git repository: '/home/sebastian/WORKING_DIR/.repo/projects/external/ipsec-tools.git'
fatal: Not a git repository: '/home/sebastian/WORKING_DIR/.repo/projects/external/ipsec-tools.git'
fatal: Not a git repository: '/home/sebastian/WORKING_DIR/.repo/projects/external/ipsec-tools.git'
Traceback (most recent call last):
  File "/home/sebastian/WORKING_DIR/.repo/repo/main.py", line 500, in <module>
    _Main(sys.argv[1:])
  File "/home/sebastian/WORKING_DIR/.repo/repo/main.py", line 476, in _Main
    result = repo._Run(argv) or 0
  File "/home/sebastian/WORKING_DIR/.repo/repo/main.py", line 155, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/sebastian/WORKING_DIR/.repo/repo/subcmds/sync.py", line 635, in Execute
    fetched = self._Fetch(to_fetch, opt)
  File "/home/sebastian/WORKING_DIR/.repo/repo/subcmds/sync.py", line 339, in _Fetch
    self._FetchProjectList(**kwargs)
  File "/home/sebastian/WORKING_DIR/.repo/repo/subcmds/sync.py", line 234, in _FetchProjectList
    success = self._FetchHelper(opt, project, *args, **kwargs)
  File "/home/sebastian/WORKING_DIR/.repo/repo/subcmds/sync.py", line 275, in _FetchHelper
    no_tags=opt.no_tags, archive=self.manifest.IsArchive)
  File "/home/sebastian/WORKING_DIR/.repo/repo/project.py", line 1110, in Sync_NetworkHalf
    no_tags=no_tags)):
  File "/home/sebastian/WORKING_DIR/.repo/repo/project.py", line 1845, in _RemoteFetch
    self.bare_git.pack_refs('--all', '--prune')
  File "/home/sebastian/WORKING_DIR/.repo/repo/project.py", line 2483, in runner
    p.stderr))
error.GitError: platform/external/ipsec-tools pack-refs: fatal: Not a git repository: '/home/sebastian/WORKING_DIR/.repo/projects/external/ipsec-tools.git'

因为它说它不是 git 存储库,我只是凭直觉在它指示的目录上运行 git init,但没有用。我还尝试删除整个 ipsec-tools.git 目录并再次运行 repo sync 以便它从头开始,但它总是给出相同的错误。

有什么想法吗?

最佳答案

没有必要从头开始sync。 Android 是一个巨大的存储库,可以从头开始下载,为了节省时间和互联网,可以删除特定的 git 存储库(通常我只看到 1 个 git 目录损坏)并重新运行同步。

repo 将项目存储在

.repo/projects

但这些只是指向实际 git 数据的软链接(soft link),这些数据存储在

.repo/project-objects

点击“项目”中的链接并删除两个存储库并再次运行同步。 它对我有用。

平台/框架/支持示例:

rm -fr .repo/projects/frameworks/support.git/ .repo/project-objects/platform/frameworks/support.git/

只同步这个项目:

repo sync -j4 platform/frameworks/support

[我想将此添加为评论,但它不允许我 - 所以添加为答案]

关于android - repo 同步结果在 "fatal: Not a git repository: ' working_dir/.repo/projects/external/ipsec-tools.git'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27130913/

相关文章:

android - 在设备上使用 ACRA 清空 Logcat

android-source - 谷歌为什么要发明特权权限白名单功能?

android - 构建android源代码(AOSP)问题

java - 类文件的未知包名

java - 由 MaterialList 的 : java. lang.ClassNotFoundException 引起

android - MultipartEntity 图片未上传

android - 如何读取 keystore 值?

git - 什么决定了 "git clone"之后的默认分支?

Git GUI/TortoiseGit 没有调用正确使用 powershell 的 Hook ? ( window )

git - 交互式 rebase 时将更改移动到不同的提交