%3CLINGO-SUB%20id%3D%22lingo-sub-1900837%22%20slang%3D%22en-US%22%3EManaging%20a%20Github%20Pull%20Request%20in%20The%20Visual%20Studio%20Using%20Git%20And%20Github%20Extension%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1900837%22%20slang%3D%22en-US%22%3E%3CP%3ENormally%20we%20always%20need%20to%20test%20the%20whole%20set%20of%20code%20before%20accepting%20a%20git%20pull%20request%2C%20in%20this%20article%20we%20will%20try%20to%20understand%20the%20best%20approach%20to%20deal%20with%20pull%20requests%20and%20test%20them%20locally.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFirst%2C%20we%20need%20to%20get%20and%20setup%20visual%20studio%20github%20extension%20%3CA%20href%3D%22https%3A%2F%2Fvisualstudio.github.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fvisualstudio.github.com%2F%3C%2FA%3E%20we%20won%E2%80%99t%20go%20through%20the%20way%20of%20setting%20up%20it%2C%20because%20this%20process%20is%20very%20well%20documented%20and%20just%20start%20from%20creating%20a%20pull%20request%20in%20the%20visual%20studio%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image--000.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F235191iD9145C2B3B667FCA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image--000.jpg%22%20alt%3D%22image--000.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPull%20request%20is%20being%20created%20based%20on%20the%20branch%20in%20this%20case%20I%20took%20movingtoRC%20one%20as%20I%20want%20ask%20someone%20to%20check%20my%20changes%20and%20confirm%20that%20I%20can%20merge%20them%20to%20the%20main%20one%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image--001.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F235192i2425919490AE78BC%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image--001.jpg%22%20alt%3D%22image--001.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20we%20have%20now%20our%20pull%20request%20ready%2C%20we%20can%20see%20that%20it%20received%20an%20identifier%20%236%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image--002.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F235193iB10519C24AC7EBA3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image--002.jpg%22%20alt%3D%22image--002.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet%E2%80%99s%20get%20this%20pull%20request%20as%20a%20branch%20locally%20with%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Egit%20fetch%20origin%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image--003.jpg%22%20style%3D%22width%3A%20979px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F235194i88A4EC734187E608%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image--003.jpg%22%20alt%3D%22image--003.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAnd%20checkout%20it%20locally%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image--004.jpg%22%20style%3D%22width%3A%20979px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F235195iA004AB07CF6C9F56%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image--004.jpg%22%20alt%3D%22image--004.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EActive%20branch%20is%20now%20TEST%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Picture6.png%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F234402iF3185B057102257D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Picture6.png%22%20alt%3D%22Picture6.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20we%20are%20going%20to%20merge%20main%20into%20our%20pull%20request%20branch%20for%20testing%2C%20mainly%20we%20need%20to%20make%20sure%20here%20that%20master%20is%20up%20to%20date%20and%20start%20merging%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20use%20%3CSTRONG%3Egit%20checkout%20master%3C%2FSTRONG%3E%20to%20ensure%20that%20branch%20is%20up%20to%20date%3C%2FP%3E%0A%3CP%3E2.%20In%20my%20case%20as%20you%20can%20see%20it%20did%20not%20work%20because%20I%20had%20one%20commit%20which%20was%20not%20posted%20to%20main%2C%20in%20this%20case%20you%20can%20do%20resync%2Fupdate%20from%20the%20VS%20extension%2C%20to%20get%20the%20latest%20version%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Picture7.png%22%20style%3D%22width%3A%20369px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F234403i2E0563754F1EA738%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Picture7.png%22%20alt%3D%22Picture7.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E3.%20After%20master%20is%20up%20to%20date%2C%20we%20are%20switching%20back%20to%20TEST%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Egit%20checkout%20TEST%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E4.%20And%20finally%2C%20we%20can%20merge%20master%20to%20TEST%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Egit%20merge%20master%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Picture8.png%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F234404i61E42FBE8C935826%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Picture8.png%22%20alt%3D%22Picture8.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20output%20we%20can%20see%20already%20the%20conflict%20as%20intended%20in%20the%20git%20output%2C%20but%20what%20is%20more%20important%20we%20have%20the%20conflicts%20and%20changes%20in%20the%20branch%20which%20is%20ready%20to%20be%20tested%20directly%20via%20Visual%20Studio%2C%20so%20we%20can%20switch%20now%20to%20VS%20and%20edit%2Ftest%2Fbuild%20conflict%20files%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Picture9.png%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F234405iCC74FF4F05549DB6%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Picture9.png%22%20alt%3D%22Picture9.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1900837%22%20slang%3D%22en-US%22%3E%3CDIV%20id%3D%22lia-teaserTinyMceEditorsergeprivan_1%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22screencap.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F234407i50DCE5D5C8E8E934%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22screencap.png%22%20alt%3D%22screencap.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1900837%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Cloud%20Service%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Service%20Fabric%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

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 https://visualstudio.github.com/ 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:

 

image--000.jpg

 

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:

 

image--001.jpg

 

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

 

image--002.jpg

 

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

 

git fetch origin

 

image--003.jpg

And checkout it locally

 

image--004.jpg

Active branch is now TEST

 

image--005.jpg

 

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:

 

Picture7.png

 

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

 

image--007.jpg

 

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 

 

image--008.jpg