如何使用检出的提交/分支更新清单?

huangapple go评论62阅读模式
英文:

How can I update the manifest with the checked out commits/branches?

问题

我的 manifest.xml 包含了所有克隆 master 分支的存储库。
我在一些存储库上进行了一些工作,并创建了新的提交、分支和标签。
现在,我想在清单中保存所有这些存储库的位置,以及它们使用的分支、标签或提交。

我应该如何做?我正试图从 git 子模块 切换到 git-repo

英文:

My manifest.xml has all my repositories cloning master.
I do some work on few repositories and create new commits, branches and tags.
Now, I want to save in the manifest where all these repositories are, which branch, tags or commits.

How can I do it? I'm trying to switch from git submodules to git-repo.

答案1

得分: 1

要将当前仓库的状态保存到foo.xml中,请运行

repo manifest -r -o foo.xml

确保新的提交已经推送到分支/标签。否则,如果foo.xml用于从foo.xml中指定的远程服务器“repo sync”这些仓库,将会引发错误。

您可以将foo.xml添加并提交到.repo/manifests,然后将其推送到远程清单仓库,这样您和其他人都可以使用它来“repo sync”具有相同修订版本的相同仓库。

最好不要用foo.xml覆盖manifest.xml。manifest.xml用于下载最新的修订版本,而foo.xml用于下载特定的修订版本。

英文:

To save the status of the current repositories to foo.xml, run

repo manifest -r -o foo.xml

Make sure the new commits have been pushed to the branches/tags. Otherwise, it would raise errors if foo.xml is used to repo sync these repositories from the remote server specified in foo.xml.

You can add and commit foo.xml in .repo/manifests and push it to the remote manifest repository, so that you and others can use it to repo sync the same repositories with the same revisions.

It's better not to overwrite manifest.xml with foo.xml. The manifest.xml is used to download the latest revision, and foo.xml is used to download the specific revision.

huangapple
  • 本文由 发表于 2023年5月26日 15:08:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76338394.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定