Skip to content

Instantly share code, notes, and snippets.

@bplaat
Last active December 11, 2025 07:58
Show Gist options
  • Select an option

  • Save bplaat/ad59302a2ec620e96394b0a98056ff5b to your computer and use it in GitHub Desktop.

Select an option

Save bplaat/ad59302a2ec620e96394b0a98056ff5b to your computer and use it in GitHub Desktop.
Script to extract folder from monorepo
# For macOS install git-filter-repo
brew install git-filter-repo
# Remove all git commits except touching 'bin/bible/' and 'bible/'
git filter-repo --path bin/bible/ --path bible/ --path-rename bin/bible/: --force
# Delete all inrelevant tags
git tag -l | grep -v '^bible' | xargs git tag -d
# Delete all branches except the current one
git branch | grep -v "$(git rev-parse --abbrev-ref HEAD)" | xargs git branch -D
# Set the remote URL to use SSH
git remote set-url origin git@github.com:bplaat/bible.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment