Skip to content

Instantly share code, notes, and snippets.

@igilham
Created February 27, 2015 17:06
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 igilham/9717b31ac3e9dca11156 to your computer and use it in GitHub Desktop.
Save igilham/9717b31ac3e9dca11156 to your computer and use it in GitHub Desktop.
Migrate a file with history from one Git repo to another
cd repository
git log --pretty=email --patch-with-stat --reverse --full-index --binary -- path/to/file_or_folder > patch
cd ../another_repository
git am < ../repository/patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment