在传统方法中,我将使用此命令来 repo init 和 reposync,并且它可以工作。
\nrepo init -u https://github.com/abc/def.git -b main -m manifest.xml\nRun Code Online (Sandbox Code Playgroud)\n但由于某些原因,我需要做这样的事情\xef\xbc\x9a
\n第 1 步:将存储库克隆到我的计算机
\ngit clone https://github.com/abc/def.git\nRun Code Online (Sandbox Code Playgroud)\n步骤2:从本地.git和本地manifest.xml进行repo init(失败)
\nrepo init -m manifest.xml\nRun Code Online (Sandbox Code Playgroud)\n第 2 步失败,并显示以下消息“致命:需要清单 url (-u)”。
\n它位于 git clone 目录内。
\n有人知道如何从本地 git 存储库和本地 manifest.xml 文件存储 init 吗?如果可以请提供代码示例,谢谢。
\nElp*_*Kay 11
您有多种选择。
如果已经有一个存储库工作区,这意味着repo init已经运行并.repo存在,您可以将清单复制到.repo/manifests. 假设它是.repo/manifests/manifest.xml,或者将其重命名为.repo/manifests/my_manifest.xml以避免命名冲突。然后运行
repo sync -m my_manifest.xml
Run Code Online (Sandbox Code Playgroud)
或者
repo init -u https://github.com/abc/def.git -b main -m my_manifest.xml
# my_manifest.xml does not have to be tracked as
# long as it's under .repo/manifests
repo sync
Run Code Online (Sandbox Code Playgroud)
如果您自己的分支manifest.xml在本地存储库中进行跟踪,您还可以使用/path/to/manifests/foo
repo init -u file:///path/to/manifests -b foo -m manifest.xml
repo sync
Run Code Online (Sandbox Code Playgroud)
file://可以省略。
顺便说一句,remote清单文件中的元素也可以是本地存储库。
| 归档时间: |
|
| 查看次数: |
17943 次 |
| 最近记录: |