title: Git how to merge repository into specific directory?
body: <p>I worked on a new version (rewrote it in go) of my project in a seperate repository. Now that I have basically implemented all functionality in the rewrite, I would like to add it to the main repository into a directory called <code>backend</code> or something.</p>
  <p>I would prefer keeping the commits I did in the seperate repository, otherwise I would just copy all the source files.</p>
  <p>I have already tried adding the new repository as a remote and merging, but it puts the source files in the repository root, not in a seperate directory.</p>
  <p>The tree of the rewrite repository looks something like this:</p>
  <pre><code>.
  ├── db
  │   ├── file1.go
  │   ├── file2.go
  ├── docker-compose.yml
  ├── Dockerfile
  ├── docs.md
  ├── go.mod
  ├── go.sum
  ├── logging
  │   └── logging.go
  ├── main.go
  ├── README.md
  ├── routes
  │   ├── route1.go
  │   ├── route2.go
  </code></pre>
  <p>The tree of the original repository looks something like this:</p>
  <pre><code>.
  ├── backend
  ├── backend-old
  └── frontend
  </code></pre>