-
-
Save rip747/638752 to your computer and use it in GitHub Desktop.
git extract directory into it's own repo
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
#!/bin/bash | |
FROM=$1 #/cygdrive/c/temp/oldrepo | |
TO=$2 #/cygdrive/c/temp/newrepo | |
echo "Spliting '$TO' from '$FROM'" | |
git clone --no-hardlinks $FROM $TO | |
cd $TO | |
git filter-branch --subdirectory-filter $TO HEAD -- --all | |
git reset --hard | |
git gc --aggressive | |
git prune | |
git remote rm origin | |
echo "DONE!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment