Created
March 17, 2023 17:27
-
-
Save Boo-urns/16ac8146807f7826e17a3e5230e90556 to your computer and use it in GitHub Desktop.
migrate-repo.sh
This file contains 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
#!/bin/bash | |
echo "Let's migrate a package! Make sure this is running in the root of your monorepo." | |
read -p "Package name: " name | |
read -p "Repo URL (ssh://git...): " repo | |
# Setup the remote git repo | |
git remote add $name $repo | |
git fetch $name | |
read -p "Which branch should we merge? " branch | |
git merge $name/$branch --allow-unrelated-histories | |
read -p "Where do we move it to? " location | |
git mv $name/ $location/ | |
git commit -m "Move $name to $location" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment