0

I have a repository A and B and want to migrate both repositories into C, I tried below steps

git clone --bare <A-url>
cd to the A.git directory
git push --mirror <C-url>

Now C has same copy of A

git clone --bare <B-url>
cd to the B.git directory
git push --mirror <C-url>

Here repository C is having only folders and files from repo B and the content from repository A removed Is there any way to persist/retain the files in repository C ?

Jafar
  • 130
  • 3
  • 17
  • Possible duplicate of [Combining multiple git repositories](https://stackoverflow.com/questions/277029/combining-multiple-git-repositories) – phd Oct 11 '18 at 13:16
  • https://stackoverflow.com/search?q=%5Bgit%5D+combine+repositories – phd Oct 11 '18 at 13:16

1 Answers1

0

Use the git subtree add command like in this doc: https://git-memo.readthedocs.io/en/latest/subtree.html#adding-a-subtree-to-a-project

Philippe
  • 28,207
  • 6
  • 54
  • 78