Skip to content

Instantly share code, notes, and snippets.

@jfbercher
Created November 1, 2015 20:25
Show Gist options
  • Save jfbercher/2048774e6992de88dd71 to your computer and use it in GitHub Desktop.
Save jfbercher/2048774e6992de88dd71 to your computer and use it in GitHub Desktop.
Extracting a directory from a git repo, with history
#from http://alyssafrazee.com/popping-a-subdirectory.html
git clone [email protected]:jfbercher/IPython-notebook-extensions.git
mv IPython-notebook-extensions/ latex_envs
git filter-branch --prune-empty --subdirectory-filter testing/latex_envs master
cd JFB/latex_envs/
git remote rm origin
git remote add origin https://github.com/jfbercher/latex_envs.git
git push -u origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment