Skip to content

Instantly share code, notes, and snippets.

@wmfairuz
Created April 4, 2014 09:20
Show Gist options
  • Save wmfairuz/9971064 to your computer and use it in GitHub Desktop.
Save wmfairuz/9971064 to your computer and use it in GitHub Desktop.
Create a new project from a subfolder of another project
cd super-project
git subtree split --prefix=sub-folder --branch=sub-folder-only
mkdir new-sub-folder
pushd new-sub-folder
git init
git remote add origin git@github.com:my-user/new-project.git
git pull ../ sub-folder-only
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment