Created
April 15, 2019 03:54
-
-
Save IrakliJani/2922d5f5c8242caa0220ed1d9a4dba3d to your computer and use it in GitHub Desktop.
Git code move from repo A to repo B with history
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
git clone [repo-A-url] [repo-A-name] | |
cd [repo-A-name] | |
git checkout [branch-in-repo-A] | |
git remote rm origin | |
git filter-branch --subdirectory-filter [directory-to-move] -- --all | |
mkdir [folder-to-move] | |
mv * [folder-to-move] # mind the hidden files | |
git add --all | |
git commit | |
cd [repo-B-path] | |
git checkout -b [branch-name] | |
git remote add [move-origin] [repo-A-path] | |
git pull [move-origin] [branch-in-repo-A] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment