Last active
December 11, 2025 07:58
-
-
Save bplaat/ad59302a2ec620e96394b0a98056ff5b to your computer and use it in GitHub Desktop.
Script to extract folder from monorepo
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
| # 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