Open 130s opened 2 years ago
For a repo that is less critical to maintain the commit history cleanest and preserve original commits, consolidation (medium.com) might be fine.
echo "Create an empty repo locally, CD into a new cosolidated repo." && mkdir -p org/suborg/reponame && cd org/suborg/reponame && git remote add origin git@gitlab.com:top-group/org/suborg/reponame.git
echo "Consolidate repos."
git remote add -f reponame https://gitlab.com/top-group/reponame/reponame
git merge --allow-unrelated-histories reponame/develop
git remote add -f reponame_ai https://gitlab.com/top-group/reponame/reponame_ai
git merge --allow-unrelated-histories reponame_ai/develop
git remote add -f reponame_tools https://gitlab.com/top-group/reponame/reponame_tools
git merge --allow-unrelated-histories reponame_tools/develop
echo "Top level dirs from each repo remain in the top level dir."
I've done it a few times and I always forgot how to do that...Needs to be taken as a note.