Skip to content

Instantly share code, notes, and snippets.

@Boo-urns
Created March 17, 2023 17:27
Show Gist options
  • Save Boo-urns/16ac8146807f7826e17a3e5230e90556 to your computer and use it in GitHub Desktop.
Save Boo-urns/16ac8146807f7826e17a3e5230e90556 to your computer and use it in GitHub Desktop.
migrate-repo.sh
#!/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