I am used to TFVC and I am trying to get to grips with Git in Visual Studio 2022 17.10.3.
In TFVC you could create a code review request before check-in, on pending changes in your local workspace, or on shelved changes. The equivalent of check-in in Git seems to be Commit then Push (so the changes are available in the remote repository), but there does not seem to be anyway to request someone to review your code during this process.
Instead, if my understanding of
https://learn.microsoft.com/en-us/visualstudio/version-control/git-create-pull-request?view=vs-2022 is correct, I have to create a pull request from one remote branch to another. Can I not create a pull request from the local branch to which I have committed my changes, to the remote repository?
Imagine in Azure Dev Ops I have an origin/dev branch on which I run nightly build pipelines (this dev branch was branched from origin/main). I have cloned the ADO repository to my local repository. I commit changes to my local dev branch. I want these changes to be code reviewed, ideally before they are pushed to the remote origin/dev. It does not seem there is anyway to do this in Visual Studio. Instead, it seems I need to locally branch from dev, e.g.,
dev2, commit changes to dev2, push dev2 to the remote origin/dev2, and then create a pull request to merge the remote origin/dev2 to origin/dev. The reviewer of the pull request can then review the changes.
With this approach it seems the remote repository will get littered with lots of “dev2” type branches from developers who want their code to be reviewed.
Is this correct or is there an easier way to do this?
I am aware of this issue being raised in the Microsoft Developer community, with no satisfactory resolution: https://developercommunity.visualstudio.com/t/code-review-without-a-pull-request/444630.