Created
January 17, 2010 22:18
-
-
Save ptrv/279621 to your computer and use it in GitHub Desktop.
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
Splitting git repository. | |
============ | |
* Do the clone and the filter: | |
`git clone --no-hardlinks foo bar; cd bar` | |
`git filter-branch --subdirectory-filter subdir/you/want HEAD` | |
* Remove every reference to the old history. "origin" was keeping | |
track of your clone, and “original” is where filter-branch saves | |
the old stuff: | |
`git remote rm origin` | |
`rm -r .git/refs/original/` | |
`git reflog expire --expire=now --all` | |
* Even now, your history might be stuck in a packfile that fsck won't touch. Tear it to shreds: | |
`git gc --aggressive` | |
* Only now does git-fsck find unused commits! Now git-prune will delete them: | |
`git prune` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment