Skip to content

Instantly share code, notes, and snippets.

@dusta
Created April 9, 2020 10:07
Show Gist options
  • Save dusta/308e031a904ff8d2a02fa0ae137c60b0 to your computer and use it in GitHub Desktop.
Save dusta/308e031a904ff8d2a02fa0ae137c60b0 to your computer and use it in GitHub Desktop.
Split folder or file in to a new repo

Replace DIR or FILE to you folder

git filter-branch --index-filter 'git rm --cached -qr --ignore-unmatch -- . && git reset -q $GIT_COMMIT -- DIR DIR FILE' --prune-empty -- --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment