# Move a registered package to a subfolder of another package

**URL:** <https://discourse.julialang.org/t/move-a-registered-package-to-a-subfolder-of-another-package/77272>\
**Category:** Package Management\
**Tags:** question, package, git\
**Created:** [March 2, 2022, 4:44am UTC](https://discourse.julialang.org/t/move-a-registered-package-to-a-subfolder-of-another-package/77272 "2022-03-02T04:44:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Norman](https://avatars.discourse-cdn.com/v4/letter/n/97f17d/32.png) [@Norman](https://discourse.julialang.org/u/Norman)\
**Post date:** [March 2, 2022, 4:44am UTC](https://discourse.julialang.org/t/move-a-registered-package-to-a-subfolder-of-another-package/77272/1 "2022-03-02T04:44:33Z")

</div>

Suppose there is a package A registered on `General` that need to be moved to a subfolder `lib` inside package B. If I understood correctly, after the merge, one should be able to find all the older versions after `git clone` repo B as the info on the registry will be modified to be the repo B.

What I have done is as follows. I used `git filter-repo` as in [here](https://stackoverflow.com/questions/1425892/how-do-you-merge-two-git-repositories/10548919#10548919) on package A and then I did a merge following the steps [here](https://docs.github.com/en/get-started/using-git/about-git-subtree-merges). The only differences from the steps in the git-subtree-merge here are that I set the remote to the local package A after applying `git filter-repo --to-subdirectory-filter` on A  
and I also add the flag `--squash` in the `merge` command to prevent all the commits showing up in the new commit history.

The entire process looks like this:

```
 cd A
 git filter-repo --to-subdirectory-filter A
 cd B
 git remote add -f tomerge A
 git merge -s ours --no-commit --allow-unrelated-histories --squash A/master
 git read-tree --prefix=lib/ -u tomerge/master
 git commit
 git push

```

So, here is the issue. I follow the tests [here](https://github.com/JuliaRegistries/General/pull/35965) to verify whether the `SHA`s for all the old versions of package A can be found in repo B. If I do that in the local repo where the merge happened, then I can find all the trees for the old versions of A. But, after `git push` to GitHub and then `git clone`. I cannot find the old versions in the new local repo.

What would be the correct steps to do for the package merge? Thank you!
