Combining two git repositories
Use Case
I have:
- folder_a/app_A
- folder_b/app_B
I want to merge app_B into app_A and keep all history.
How can I merge the branches together?
switch to repo A
cd folder_a
Add repo B as a remote repository
git remote add folderb /path/to/folder_b
Pull B's master branch into a local branch named 'b'
git pull folderb master:b
// for my project toko-online, stop at this step is sufficient
Merge b into A's master branch
git merge b
Switch to repo B
cd ../folder_b
Add repo A as a remote repository
git remote add foldera /path/to/folder_a
Pull the resulting branch into repo B's master branch
git pull foldera master:master
Another tutorial to read :
Combining two git repositories
https://gist.github.com/msrose/2feacb303035d11d2d05#file-combining-git-repositories-md