android - 带有非 android 项目的回购
问题描述
我正在做一个项目,我试图将几个模块整合到一个解决方案中。每个模块都在它们自己的文件夹中,并且是 git 存储库。这些都存储在C:\sourcecode\Modules
最终它们将在 GitHub 上。在深入审查了使用存储在 git 存储库中的模块组成的解决方案的不同方法之后,我决定尝试Repo
为 AOSP 构建的 Google。
我根据这里的回购要求安装了所有工具https://source.android.com/setup/develop并在该文件夹C:\sourcecode\Repotest
中创建了一个文件夹我创建了一个名为 default.xml 的文件。该文件夹的内容非常简单:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="origin"
fetch="/c/sourcecode/Modules" />
<default revision="master"/>
<project path="AnalystQualification" name="AnalystQualification" />
</manifest>
我以管理员身份启动 git-bash 并运行:
$ cd /c/sourcecode/Repotest/
$ repo init -u default.xml
我得到输出:
$ repo init -u default.xml
Downloading manifest from default.xml
Traceback (most recent call last):
File "C:\sourcecode\Repotest\.repo\repo\main.py", line 630, in <module>
_Main(sys.argv[1:])
File "C:\sourcecode\Repotest\.repo\repo\main.py", line 604, in _Main
result = run()
File "C:\sourcecode\Repotest\.repo\repo\main.py", line 597, in <lambda>
run = lambda: repo._Run(name, gopts, argv) or 0
File "C:\sourcecode\Repotest\.repo\repo\main.py", line 266, in _Run
result = cmd.Execute(copts, cargs)
File "C:\sourcecode\Repotest\.repo\repo\subcmds\init.py", line 531, in Execute
self._SyncManifest(opt)
File "C:\sourcecode\Repotest\.repo\repo\subcmds\init.py", line 232, in _SyncManifest
default_branch = m.ResolveRemoteHead()
File "C:\sourcecode\Repotest\.repo\repo\project.py", line 1926, in ResolveRemoteHead
output = self.bare_git.ls_remote('-q', '--symref', '--exit-code', name, 'HEAD')
File "C:\sourcecode\Repotest\.repo\repo\project.py", line 3040, in runner
raise GitError('%s %s: %s' %
error.GitError: manifests ls-remote: fatal: invalid gitfile format: default.xml
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Downloading Repo source from https://gerrit.googlesource.com/git-repo
我认为这个错误告诉我 default.xml 中的设置看不到目录中的 .git 文件夹,modules/analystqualification
但如果我可以看到它ls -l
$ ls -l /C/sourcecode/Modules/AnalystQualification
total 4
drwxr-xr-x 1 adam.wheeler 1049089 0 Jan 12 10:01 Setup_AQ/
任何帮助在这里表示赞赏。谢谢!
亚当
解决方案
repo init -u url_to_manifest_repo -m foo.xml -b manifest_repo_branch
url_to_manifest_repo
应该是一个跟踪foo.xml
. 它可以在本地磁盘中,也可以在远程托管服务器中。在你的情况下,它是/c/sourcecode/Repotest
. 确保这/c/sourcecode/Repotest
是一个 git 存储库并且default.xml
已被跟踪。
foo.xml
是清单文件相对于url_to_manifest_repo
根目录的路径。-m foo.xml
可以省略。如果是这样,-m default.xml
则默认使用。
manifest_repo_branch
是保存特定版本的分支foo.xml
。如果-b manifest_repo_branch
省略,则默认为-b master
.
因此,在您的情况下,命令将是:
repo init -u /c/sourcecode/Repotest -m default.xml -b master
或者简单地说:
repo init -u /c/sourcecode/Repotest
对于本地存储库,它也可以是-u file:///c/sourcecode/Repotest
.
推荐阅读
- angular - 类型 Object 上不存在属性长度
- codenameone - SimpleDateFormat:ParseException,但字符串日期看起来没问题
- sql - SQL Developer 架构名称
- python - 从值数组构建参数化 SQL 语句
- html - 悬停时更改 SVG 图像颜色
- jboss - 哪里
从 jboss-web.xml 定义 - idris - Idris rewrite 没有改变类型
- magento2 - Magento 2 扩展,用于从前端提交表单并将值保存到数据库表
- jquery - 如何在jquery数据表中隐藏第一页上的上一页和最后一页的下一页
- c# - 如何使用 NEST 6.1.0 实现建议完成?