Skip to content

Instantly share code, notes, and snippets.

@leotac
Last active October 11, 2019 20:15
Show Gist options
  • Save leotac/483f2e3e459d68c114b7 to your computer and use it in GitHub Desktop.
Save leotac/483f2e3e459d68c114b7 to your computer and use it in GitHub Desktop.
Create new repo from subdirectory
mkdir subdir-fork
cd subdir-fork
git clone [email protected]:sbebo/REPO.git
git filter-branch --prune-empty --subdirectory-filter <SUBFOLDER> master
git remote -v
git remote rm origin
git remote add origin [email protected]:sbebo/<NEWREPO>.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment