如何在Gerrit中采用几个顶级项目并将其移至另一个“容器”项目下?(How can one take several top

编程入门 行业动态 更新时间:2024-10-23 07:25:13
如何在Gerrit中采用几个顶级项目并将其移至另一个“容器”项目下?(How can one take several top-level projects in Gerrit and move them under another “container” project?)

我有一个Gerrit安装,其中有几个相关项目(每个都在一个git存储库中)。 另一个即将上线的项目也将使用gerrit,但为了整洁,我想采用现有的一组项目并将它们置于一个新的超级项目之下(以便在顶层看到“伞形”项目我还想保留我们为此提供的数据(例如,审核历史)。

如何做这样的事情? 另一种看待这种情况的方法是,如何将gerrit中的子项目从一个超级项目移动到另一个超级项目?

I have a Gerrit installation within which are several related projects (each in a git repository). Another project is coming online would also use gerrit, but for the sake of tidiness I'd like to take the existing set of projects and put them under a new super-project (so that at the top level one sees the "umbrella" projects. I'd also like to retain the data we have for this (e.g., the review history).

How does one go about doing something like this? Another way of looking at this is, how does one move a sub-project in gerrit from one super-project to another?

最满意答案

感谢今天早上我偶然发现的这篇博文 ,我找到了解决方案的坚实途径! 虽然它不是很简单但它很强大而且很有效。

确保您已经创建了将子项目重新为子项目的伞形项目,并执行以下步骤:

MYGERRIT=ssh://${MYGERRIT_IP}:${MYGERRIT_PORT} mkdir ~/x cd ~/x # Clone the repo for the subproject you want to re-parent git clone ${MYGERRIT}/<subproject> cd <subproject> git fetch origin refs/meta/config:refs/remotes/origin/meta/config git checkout meta/config # Make changes to project.config -----> inheritFrom = <your_umbrella_project_name> # Commit changes git add -A EDITOR=vi git commit -a # Push changes git push origin meta/config:meta/config # If pushing directly #git push origin meta/config:refs/for/meta/config # If going through gerrit # Flush gerrit caches ssh -p ${MYGERRIT_PORT} ${MYGERRIT_IP} gerrit flush-caches --cache project_list ssh -p ${MYGERRIT_PORT} ${MYGERRIT_IP} gerrit flush-caches --cache projects

Thanks to this blog post I stumbled upon this morning, I found a solid path to the solution! While it's not exactly simple it's robust and it works.

Ensure you've already created the umbrella project you will be re-parenting the subproject to, and perform the following steps:

MYGERRIT=ssh://${MYGERRIT_IP}:${MYGERRIT_PORT} mkdir ~/x cd ~/x # Clone the repo for the subproject you want to re-parent git clone ${MYGERRIT}/<subproject> cd <subproject> git fetch origin refs/meta/config:refs/remotes/origin/meta/config git checkout meta/config # Make changes to project.config -----> inheritFrom = <your_umbrella_project_name> # Commit changes git add -A EDITOR=vi git commit -a # Push changes git push origin meta/config:meta/config # If pushing directly #git push origin meta/config:refs/for/meta/config # If going through gerrit # Flush gerrit caches ssh -p ${MYGERRIT_PORT} ${MYGERRIT_IP} gerrit flush-caches --cache project_list ssh -p ${MYGERRIT_PORT} ${MYGERRIT_IP} gerrit flush-caches --cache projects

更多推荐

本文发布于:2023-07-05 06:55:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1034380.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:几个   项目   容器   移至   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!