git - 错误:无法获取 linaro-swg/arm-trusted-firmware.git
问题描述
我正在尝试按照以下过程在 linux Ubuntu OS 上构建 OP-TEE https://optee.readthedocs.io/building/gits/build.html#get-and-build-the-solution
在第 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?
谢谢
解决方案
正如H. Mijail 的博客上所说,在repo sync --force-sync 中会覆盖您现有的存储库!:
看起来 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 元数据”是指
.git
mydirectory 中的整个目录。
因此,现有本地存储库中的任何分支、任何存储、任何内容都将被销毁。也没有办法重新登录!运行
repo --force-sync
后,repo 将在进一步的 repo 同步调用中接受存储库。使用的替代方法
--force-sync
可能是使用--force-break
(或简单地-f
),它只会在任何目录无法同步时继续。
但是我没有尝试,如果我们假设 repo 没有进入它没有创建的目录,我什至不知道这会有什么意义。
无论如何...首先备份您的本地存储库!
推荐阅读
- javascript - ExtJS Datefield TypeError j[d] 不是函数
- c# - 输入不是有效的 Base64 字符串,因为它包含非 base 64 字符
- java - 我制作了一个 Java 程序但有重复问题
- node.js - npm 更新目录路径混淆
- javascript - Razor - 为 radioButtonFor 赋予“属性”
- c# - 使用 Hotmail SMTP C# 发送电子邮件在本地工作,但不在实时服务器上
- javascript - javascript 只工作一次,在第一次
- c++ - 如何让线程等待条件执行操作而不使用过多的 CPU 时间?
- javascript - WebGL 注释未呈现
- python - YOLO v3 Linux VM OpenCV imtest