Using cherry-pick to select specific commits for your Pull Request.
1. Create a new branch based on the target of the Pull Request
git branch cherry-branch origin/master
2. Switch to a new branch
git checkout cherry-branch
3. Verify if you are in the new branch
Use git cherry-pick to pick up the commits into the new branch which is the branch that you are in now
Note: COMMIT-ID can be found in that commit page in Azure DevOps or GitHub. Copy the ID and paste it here:
git cherry-pick COMMIT-ID
5. Resolve Conflicts
If there is any conflict, resolve and merge all differences in VS Code or Visual Studio.
6. Continue to use cherry-pick if more commits are needed
git cherry-pick --continue :wq git cherry-pick COMMIT-ID
7. Push the new branch
git push origin cherry-branch
8. Create a Pull Request
You can now create a Pull Request from the new branch to the target branch. It will only pick up the commits your selected previously.