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
2
  • 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? Commented Feb 6, 2014 at 9:54
  • i have updated the question but no its going to be same. some documents and old stuff is there too. Commented Feb 6, 2014 at 10:10

1 Answer 1

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).

Sign up to request clarification or add additional context in comments.

2 Comments

but when you push it will change the remote structure as well, won't it.. That we can't do
@Waqas it will change the structure on a dedicated branch only, so it shouldn't have any visible impact.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.