0

I currently have two repositories. one php/laravel backend and frontend in vue/typescript:

repo1: backend repo2: frontend

I would like to merge both into one single repo. Each should be in it's own subdirectory.

So the new repo could be called "webapp" and have a directory backend and frontend.

Is there a recommended way to do this?

I would also like to keep the git history of the existing repos in the new repo. Is this possible?

The main reason is that my team consists of only full stack devs, so everyone works on both parts anyways and it would simplify our pull requests since it makes sure that the new frontend and backend code gets merged at once.

Chris
  • 13,100
  • 23
  • 79
  • 162

1 Answers1

0

Check this description: https://blog.devgenius.io/how-to-merge-two-repositories-on-git-b0ed5e3b4448. Basically, the idea is to take the first repository, add the second repository as remote, then checkout it locally and merge to the first repo main branch.

kosist
  • 2,868
  • 2
  • 17
  • 30