如何 "partial sync" 在两个不同的 git 存储库之间编码?

How to "partial sync" code between two different git repositories?

假设我有两个 git 存储库。一开始,这两个repos的代码是一样的。但是回购 2 也需要对回购 1 的一些提交,但其他一些则不需要。

那么对于这种情况,最佳做法是什么?如何将一些提交从一个回购合并到另一个?

谢谢。

假设REPO_1是第一个仓库的URL,REPO_1是第二个仓库的路径,运行第二个仓库中的这个:

git remote add upstream REPO_1
git pull upstream
git cherry pick <hash_of_commit_to_select>...