Last active
January 3, 2024 19:35
-
-
Save tcartwright/3c4757c2fe9e4ea8cee2575d8d74d9ad to your computer and use it in GitHub Desktop.
GIT: Moves a project from one repo to another preserving 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
@REM Make sure you are in the root folder of the git repo that you wish to move the code to | |
git checkout master | |
git remote add r1remote **url-of-repo1** | |
git fetch r1remote | |
git merge r1remote/master --allow-unrelated-histories | |
git remote rm r1remote |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NOTE: When the merge occurs, you should deal with any merge conflicts and commit the changes if you are doing multiple projects.