title: What's the best way to selectively share changes between two Git repositories?
body: <p>We have a Git repository (in Azure DevOps) containing code for a library which is going to be refactored heavily in certain areas. However, some areas of the code will remain (almost) unchanged. As part of the changes, the library will get a new name. This is why we plan to create a new repository for these changes, so that the refactored library is clearly separated from the original library.</p>
  <p>The refactoring will take some time, and during that time, we'll be forced to maintain the old version of the library and provide bugfixes and possibly new features. Since parts of the library will remain unchanged, we would like to be able to merge those bugfixes from the old repository to the new repository (and probably vice versa). However, we do not want to merge ALL changes, but only specific ones - kind of cherry-picks between two repositories. I know that this may not be possible forever since the two repositories will diverge more and more.</p>
  <p>What's the best solution for such a scenario?</p>
  <p>I have thought of the following solutions:</p>
  <ol>
  <li>Create a new repository, clone the old repository, change the remote of that clone to the new repository, and push everything to the new repository. Afterwards do the renaming and refactoring in the new repo, and do the bugfixing in the old repo. If a bugfix should be merged to the new repo, I would switch my working copy to the new repo, and cherry-pick the revision with the bugfix from the old repo by specifying the old repo as the remote.</li>
  <li>Create a fork of the old repo, perform the renaming and refactoring in the fork, and do the bugfixing in the original repo. A bugfix from the original repo could be merged to the fork using a pull request, and also vice versa if required. I am unsure if this approach would support the selective cherry-picking. I fear that I would only be able to merge ALL changes from original to fork which is not what I want.</li>
  </ol>
  <p>As you can see, my experience with Git is limited and I would need some advice. Is one of the proposed options a viable solution, or is there a better way to approach this?</p>