Created
May 24, 2013 13:50
-
-
Save borkweb/5643656 to your computer and use it in GitHub Desktop.
Migrate a directory (with history) to a separate repo.
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
# First create the blank repository, then... git clone https://github.com/borkweb/whatever.git tmp-repo git clone --no-hardlinks tmp-repo new-repo cd new-repo git filter-branch --subdirectory-filter directory-to-migrate HEAD -- --all git reset --hard git gc --aggressive git prune git remote rm origin git remote add origin https://github.com/borkweb/new-repo.git git push origin master --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why not use "git subtree split"?
http://makingsoftware.wordpress.com/2013/02/16/using-git-subtrees-for-repository-separation/