Skip to content

Instantly share code, notes, and snippets.

@delacruz-dev
Created May 26, 2017 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delacruz-dev/4814a70b3aad8335c13650750e3ba3c1 to your computer and use it in GitHub Desktop.
Save delacruz-dev/4814a70b3aad8335c13650750e3ba3c1 to your computer and use it in GitHub Desktop.
Move history from a repo to another, filtering by folder
  1. git clone
  2. cd
  3. git remote rm origin
  4. git filter-branch --subdirectory-filter <directory 1> -- --all

You may need also to merge histories, if the new repo already exists. In order to do that, make:

  1. git pull --allow-unrelated-histories

And finally,

  1. git remote add
  2. git push -u origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment