[英]Transforming a git repo automatically
Summary: is it possible to easily mirror a remote branch while also applying a transformation to it?摘要:是否可以轻松地镜像远程分支,同时对其进行转换?
Detail: The official Arch package repo holds configuration in a folder per package:详细信息:官方 Arch package repo 将配置保存在每个 package 的文件夹中:
https://github.com/archlinux/svntogit-community/tree/master/a2jmidid/trunk https://github.com/archlinux/svntogit-community/tree/master/a2jmidid/trunk
It is also set up to have a branch per package which seems to point to the same place:它还设置为每个 package 有一个分支,这似乎指向同一个地方:
https://github.com/archlinux/svntogit-community/tree/packages/a2jmidid/trunk https://github.com/archlinux/svntogit-community/tree/packages/a2jmidid/trunk
As the repo is quite large and I'm only interested in specific packages, I'm looking for a way to track specific parts of the repo, in order to fork further.由于 repo 很大而且我只对特定的包感兴趣,我正在寻找一种方法来跟踪 repo 的特定部分,以便进一步分叉。 I'm also just interested in the trunk folder.
我也只是对主干文件夹感兴趣。
Ideally I want to end up with a repo for the above that can be accessed with:理想情况下,我希望最终得到一个可以通过以下方式访问的 repo:
Git://localserver/packages/a2jmidid.git Git://localserver/packages/a2jmidid.git
Where cloning the above ends up with the contents of the trunk folder (and related history) of the specific package.克隆上述内容的最终结果是特定 package 的主干文件夹(和相关历史记录)的内容。
I have used --mirror for similar before, but only for full repos and their many branches.我以前用过 --mirror 类似的东西,但只用于完整的 repos 和它们的许多分支。 I suspect it's worth leveraging the package branch (vs the folder in master), but I can't see how to mirror just a single branch.
我怀疑值得利用 package 分支(与 master 中的文件夹相比),但我看不到如何只镜像一个分支。 That also wouldn't reduce the repo to just the trunk folder.
这也不会将 repo 减少到仅主干文件夹。
I've tried just cloning and copying the files I'm interested in, but that doesn't persist the history.我试过克隆和复制我感兴趣的文件,但这并没有保留历史。
I think the approach should be to clone, branch and delete/move the files around, and then in future pull/merge and commit, but I'm having trouble nailing the exact workflow.我认为该方法应该是克隆、分支和删除/移动文件,然后在将来拉/合并和提交,但我无法确定确切的工作流程。 The intention is to schedule this update.
目的是安排此更新。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.