0

In a directory, I have several application projects with their own Git repository. I need to group all projects in the directory into a single Git repository. Based on my online search, I found that I need to delete .git in those projects. That, however, doesn't work for me. The directory where I delete the .git disappear from the git status in the parent directory.

What is the right approach?

vic
  • 1,704
  • 3
  • 29
  • 59
  • You might want to check [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) – Mickael B. Apr 27 '20 at 16:47
  • There are different ways to make that work in GIT; like subtrees, submodules or merge unrelated histories. Which one you want to take depends on your current situation. You might want to check out this entry for details https://stackoverflow.com/questions/1425892/how-do-you-merge-two-git-repositories – Roland Kreuzer Apr 27 '20 at 17:00
  • Thanks both for your information. The submodule approach is more suitable to me as all of those projects are independent in the code level. – vic Apr 27 '20 at 17:11
  • also look at `git subtree` https://stackoverflow.com/a/61273621/8910547 – Inigo Apr 28 '20 at 02:19
  • Does this answer your question? [How do you merge two Git repositories?](https://stackoverflow.com/questions/1425892/how-do-you-merge-two-git-repositories) – Inigo Apr 28 '20 at 02:20

0 Answers0