错误:无法获取linaro-swg / arm-trusted-firmware.git

问题描述 投票:1回答:1

我正在尝试按照这个程序https://optee.readthedocs.io/building/gits/build.html#get-and-build-the-solution在Linux Ubuntu OS上构建OP-TEE

在步骤3中,使用命令“$ repo sync -j4 --no-clone-bundle”,出现以下错误消息:

错误:无法获取linaro-swg / arm-trusted-firmware.git(GitError: - force-sync未启用;无法覆盖本地工作树。如果您对丢失工作树的git元数据的可能性感到满意,请使用repo sync --force-sync arm-trusted-firmware继续。)线程Thread-9中的异常:

我该怎么做才能获取linaro-swg / arm-trusted-firmware.git?

谢谢

git
1个回答
0
投票

正如H. Mijail's Blog所说,在repo sync --force-sync overwrites your existing repository!

看起来repo跟踪它已经初始化的存储库。 因此,如果您创建了一个独立于repo的存储库,然后将该现有存储库的条目添加到repo清单中,则repo sync将会阻塞并向您显示以下消息:

error.GitError: --force-sync not enabled; cannot overwrite a local work tree. If you're comfortable with the possibility of losing the work tree's git metadata, use `repo sync --force-sync mydirectory` to proceed.

事实证明,“git metadata”意味着mydirectory中的整个.git目录。 因此,任何分支,任何存储,现有本地存储库中的任何内容都将被销毁。也没有求助于reflog!

运行repo --force-sync后,存储库将被repo接受进一步的repo sync调用。

使用--force-sync的另一种方法可能是使用--force-break(或简称-f),当任何目录无法同步时,它就会继续使用。 但我没有尝试,我不知道如果我们假设repo没有进入它没有创建的目录,那将是多么有意义。

在任何情况下......首先备份本地回购!

© www.soinside.com 2019 - 2024. All rights reserved.