Created
November 18, 2017 20:14
-
-
Save IljaN/28fd7d2b086b545d843286ea95248921 to your computer and use it in GitHub Desktop.
Merge Repos
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
# create a new repo: | |
git init all_projects | |
cd all_project | |
# to make it more easy to understand, let's create a new branch | |
git checkout -b main | |
# import 1st project | |
git remote add projectA http://projectA | |
git fetch --all --tags | |
git checkout masterA projectA/master | |
git rebase masterA main | |
# move the main branch to the current state | |
git branch main -f | |
# Now your branch main is at the same state as your A project | |
# import 2st project | |
git remote add projectB http://projectB | |
git fetch --all --tags | |
git checkout masterB projectB/master | |
git rebase masterB main | |
# move the main branch to the current state | |
git branch main -f | |
# Now your branch main contains all commits from projectA and projectB | |
# etc.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment