Skip to content

Instantly share code, notes, and snippets.

@bradoyler
Created September 16, 2019 20:39
Show Gist options
  • Save bradoyler/7c6c3a507532c3a42fff09ed1b1d97e9 to your computer and use it in GitHub Desktop.
Save bradoyler/7c6c3a507532c3a42fff09ed1b1d97e9 to your computer and use it in GitHub Desktop.
extract repo from git folder

git commands

git clone --mirror ssh://[email protected]/user/repo.git filtered-repo
cd filtered-repo
git filter-branch --prune-empty --subdirectory-filter some/folder/path/ master
cd ..
git clone ./filtered-repo new-repo
cd new-repo
git status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment