Created
June 22, 2019 07:13
-
-
Save matham/ca18cd247cbd7692db45b3b8ca97fe2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from https://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/ | |
git clone <git repository A url> | |
cd <git repository A directory> | |
git remote rm origin | |
git filter-branch --subdirectory-filter <directory 1> -- --all | |
git filter-branch --index-filter ' | |
git read-tree --empty | |
git reset $GIT_COMMIT -- cplcom/painter.py | |
' -- --all -- cplcom/painter.py | |
mkdir <directory 1> | |
mv * <directory 1> | |
git add . | |
git commit | |
git clone <git repository B url> | |
cd <git repository B directory> | |
git remote add repo-A-branch <git repository A directory> | |
git pull repo-A-branch master --allow-unrelated-histories | |
git remote rm repo-A-branch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment