Skip to content

Instantly share code, notes, and snippets.

@jacklund
Last active December 17, 2015 02:38
Show Gist options
  • Save jacklund/5536712 to your computer and use it in GitHub Desktop.
Save jacklund/5536712 to your computer and use it in GitHub Desktop.
Moving subdirectories in a git repository to be their own repositories
$ git clone repo-url
$ cd repo
$ git filter-branch --prune-empty --subdirectory-filter subdir-name master
$ git remote rm origin
$ git remote add new-repo-url
$ git push -u origin --all --tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment