Skip to content

Instantly share code, notes, and snippets.

@wmfairuz
Created August 4, 2014 04:21
Show Gist options
  • Save wmfairuz/28c3989cd6ca3f37efe6 to your computer and use it in GitHub Desktop.
Save wmfairuz/28c3989cd6ca3f37efe6 to your computer and use it in GitHub Desktop.
detach folder from repo
pushd <big-repo>
git subtree split -P <name-of-folder> -b <name-of-new-branch>
popd
mkdir <new-repo>
pushd <new-repo>
git init
git pull </path/to/big-repo> <name-of-new-branch>
git remote add origin <[email protected]:my-user/new-repo.git>
git push origin -u master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment