Managing a Github Pull Request in The Visual Studio Using Git And Github Extension
Published Nov 18 2020 06:24 AM 12K Views

Normally we always need to test the whole set of code before accepting a git pull request, in this article we will try to understand the best approach to deal with pull requests and test them locally.


First, we need to get and setup visual studio github extension we won’t go through the way of setting up it, because this process is very well documented and just start from creating a pull request in the visual studio:




Pull request is being created based on the branch in this case I took movingtoRC one as I want ask someone to check my changes and confirm that I can merge them to the main one:




As we have now our pull request ready, we can see that it received an identifier #6




Let’s get this pull request as a branch locally with


git fetch origin



And checkout it locally



Active branch is now TEST




Now we are going to merge main into our pull request branch for testing, mainly we need to make sure here that master is up to date and start merging:


1. use git checkout master to ensure that branch is up to date

2. In my case as you can see it did not work because I had one commit which was not posted to main, in this case you can do resync/update from the VS extension, to get the latest version:




3. After master is up to date, we are switching back to TEST

git checkout TEST


4. And finally, we can merge master to TEST

git merge master




In the output we can see already the conflict as intended in the git output, but what is more important we have the conflicts and changes in the branch which is ready to be tested directly via Visual Studio, so we can switch now to VS and edit/test/build conflict files 




Version history
Last update:
‎Nov 20 2020 07:26 AM
Updated by: