Created
February 12, 2025 06:59
-
-
Save rakshithxaloori/bca971b652017a1a10006cef8b768e8c to your computer and use it in GitHub Desktop.
A script to merge multiple repos into a mono repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd merged-repo | |
git remote add api-repo <source-url> | |
git fetch api-repo | |
git checkout -b api-branch api-repo/main | |
mkdir api | |
find . -mindepth 1 -maxdepth 1 ! -name 'api' ! -name '.git' -exec git mv {} api/ \; | |
git commit -m "Move api repository contents to 'api' folder" | |
git checkout main | |
git merge --allow-unrelated-histories api-branch | |
# git push origin main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment