1

I have a Git repository and everything is on root, but on remote git repository the desired content is one level deep (there are three types of folder 1-git folders 2-DemoProject 3.some-other-folder-i-have-no-concern). How to merge these two together. Even though they are completely disconnected but i have found the way to merge the disconnected repository but this level thing isn't working.

LocalBranch(DemoProject)
     -(git folders)
     -Content1
     -Content2

Remote Branch
      -(git folders)  
      -DemoProject
         -Content1
         -Content2
       -Some Folder
Waqas
  • 424
  • 7
  • 15
  • It would help if the remote repo would split DemoProject into its own repo and reference it through a submodule entry. Do you have the possibility to split that remote repo in two? Or don't you have any access/control over that remote repo? – VonC Feb 06 '14 at 09:54
  • i have updated the question but no its going to be same. some documents and old stuff is there too. – Waqas Feb 06 '14 at 10:10

1 Answers1

0

One way would to:

  • clone the remote repo
  • reorganize (in a dedicated branch) its content in order to reflect your own repo
  • push that dedicated branch

Then, following "How to combine two separate unrelated Git repositories into one with single history timeline", you can combine the history of your repo on top of the remote repo (which, on that special branch, contains the right structure).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • but when you push it will change the remote structure as well, won't it.. That we can't do – Waqas Feb 19 '14 at 06:56
  • @Waqas it will change the structure on a dedicated branch only, so it shouldn't have any visible impact. – VonC Feb 19 '14 at 07:01