How can one take several top-level projects in Gerrit and move them under another “container” project?

好久不见. 提交于 2019-12-04 15:52:25

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
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!