0

I have multiple projects (solutions) each have a separate git repo setup.

I intend to merge the projects into a single solution to simplify build and distribution since all projects the same database solution. architecture is as follows

Project A (repo A):

  • "A" solution
  • Database Library Solution*
  • Wix Installer Solution
  • Wix Bundle Solution

Project B (repo B):

  • "B" Solution
  • Database Library Solution*
  • Wix Installer Solution
  • Wix Bundle Solution

*(the Database Library Solution is exactly the same in both projects, but with each change to it we need to copy paste the changes to the other project)

To simplify and unify the development environment I'd like to make it as following:

Master Project:

  • Solution A
    • Wix Installer and Bundle for A
  • Solution B
    • Wix Installer and Bundle for B
  • Database Library Solution

How do I achieve this result by unifying the project into a single solution that has a brand new git repo, while preserving Solution A and B git history?

SAFAD
  • 774
  • 3
  • 14
  • 37
  • Does this answer your question? https://stackoverflow.com/a/10548919/7421710 – Zoro Mar 20 '21 at 15:53
  • History is commits; commits are history. If you have the commits, you have the history. That's all there is to it. Put all the commits in a repository, and you have all the history. – torek Mar 20 '21 at 22:54

1 Answers1

0

You can use git submodules to achieve this. Create the master git repo and add the required git repos and git submodules by adding a .gitmodules file like:

[submodule "module1"]
    path = /path/module1
    url = https://github.com/user/module1
[submodule "module2"]
    path = /path/module2
    url = https://github.com/user/module2

You can read about git submodules here

Zoro
  • 420
  • 5
  • 16
  • I know the submodules solution, however it does not fit my case I want to have the entire solution ( a master one that includes both project A B) in a single repo, while preserving the old git history (from both project A and B together) – SAFAD Mar 20 '21 at 15:47