I have a project that use 2 different git. Both of them are the same app and what different it is a version & language. Consider Folder_1
directory is Version_1
project and Folder_2
directory is Version_2
project.
Explanation:
Folder_1
, I use C language.Folder_2
I use C# languageDirectory:
|-- Local Disk (D:)
|-- Folder_1 (D:\Folder_1)
|-- Folder_2 (D:\Folder_2)
Folder_1 git structure:
Init --- Branch1 --- Dev
\--- Branch2 --- Master
Folder_2 git structure:
Init --- Dev
\--- BranchX --- Master
\--- Test
Folder_1
git structure into Folder_2
git?Desired output:
Init --- Dev
\--- BranchX --- Master
\-- Test
\- v1_Init
\--- v1_Branch1 --- v1_Dev
\-- v1_Branch2 --- Version_1
To make one Git repo that has branches with unrelated histories all you have to do is "fetch" the objects and create the "refs".
cd repo2
git remote add repo1 /path/to/repo1
git fetch repo1
git branch v1_Dev repo1/Dev
git branch v1_Master repo1/Master
Now you can switch between the two projects just by switching branch:
git checkout v1_Master
git checkout master