> For the complete documentation index, see [llms.txt](https://alexander-rogalsky.gitbook.io/object-mappers-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alexander-rogalsky.gitbook.io/object-mappers-docs/user-guide/how-to-move-content.md).

# Repositories: How to move content from one repository to another one

## Goal

The content from the source repository should keep the Git history.

## Steps

1. Create a new repository with the content to move:

```
git clone git@github.com:AlexRogalskiy/<source-repository>.git
cd <source-repository>
git-filter-repo --path <path-to-extract> \
 --path <path-to-extract> \
 --path <path-to-extract> \
 ...
```

1. Publish that new repository
2. Add it as a remote repository to the target repository:

```
git clone git@github.com:AlexRogalskiy/<target-repository>.git
cd <target-repository>
git remote add new-content <url>
git fetch new-content
```

1. Merge the extracted content:

```
cd <target-repository>
git merge --allow-unrelated-histories new-content/master
# (adapt the content if it's necessary)
git push origin master
```

1. Remove the published repository (step 2)
2. Create a pull request into the source repository to remove the extracted content
