1

I have multiple projects in a Git repo as shown below

ProjA
 |- file1
 |- dir1/file2
 |-dir2/file3

ProjB
 |- fileA
 |-dirB/file4

I need to migrate those projects to a new Git repo, which should have the following structure:

 NewProj
  |-- ProjA --| -file1
              |-file2
              |- file3
  |--ProjB --|-file4
             |--NewDir/fileA

Any help will be appreciated.

jub0bs
  • 60,866
  • 25
  • 183
  • 186
user2779221
  • 135
  • 3
  • 11

1 Answers1

1

First of all, simple move the files in both projects ProjA and ProjB to their final destination. git should be able to detect those changes. Maybe this link is of help. If you have a remote repository, push it.

Afterwards, create a new repository in an empty folder

git init NewProj

Add the two previous projects as submodules to your new repository:

git submodule add <<path to repo>>

Done. You can find some information about submodules here.

Community
  • 1
  • 1
Felix
  • 2,531
  • 14
  • 25