-1

I have two git repositories: main and package_1. I want to merge package_1 into main and put it inside a folder, say package_1. By doing this I am ok rewriting the history of main so that I achieve interleaved commits from the two repositories, of course ordered chronologically.

I have tried solutions using git subtree add --prefix=package_1 package_1/master or for simply git merge package_1/master.

In the end I end up with a folder with no history at all. I have been searching how to do this but haven't yet found a solution for exactly what I am trying to achieve.

Vitor
  • 151
  • 6
  • https://stackoverflow.com/q/15780956/7976758 , https://stackoverflow.com/q/16972721/7976758 , https://stackoverflow.com/search?q=%5Bgit%5D+merge+linear – phd Sep 02 '23 at 15:45
  • @phd thanks but none of those help. My repos existed together in time and there are no "untracked changes". Plus the merge entails just putting a repo inside a folder in the other repo. I have not found a matching thread for this. – Vitor Sep 02 '23 at 16:04

0 Answers0