Skip to content

Instantly share code, notes, and snippets.

@regis-leray
Last active August 29, 2015 13:56
Show Gist options
  • Save regis-leray/8848287 to your computer and use it in GitHub Desktop.
Save regis-leray/8848287 to your computer and use it in GitHub Desktop.
Import git repository with history
git clone git@github.com:flyway/flyway.git
cd flyway
# move into another folder with rewriting the history
git filter-branch -f --prune-empty --tree-filter 'mkdir -p .root;mv * .root;mv .root root' -- --all
git clone git@github.com:regis-leray/flyway.git regis-flyway
cd regis-flyway/
git remote add origin-flyway ../flyway
git fetch origin-flyway
git checkout -b flyway-branch origin-flyway/master
git checkout master
git merge flyway-branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment