How to check a test request before merging it?

I work as part of a team. Our process is to create a separate branch, work on a separate branch, and then move it to "origin" and make a stretch request for master.

I am trying to get better with the default Git command line.

When another person makes a pull request on a branch. Is there an easy way to pull this branch to my local network and check the branch so that I can check the code before approving the transfer request?

+9
source share
4 answers

There is even the opportunity to check the "remote branch" directly, there is no need to create a local branch (git will say that you are working in a separate HEAD state ), therefore, using the example of Sajib:

git fetch origin git checkout origin/whatever 
+8
source

You can check the branch (say feature ) where the pull request is created.

 $ git fetch # create a new branch 'test-feature' with 'origin/feature' history $ git checkout -b test-feature origin/feature # now test here 

You can merge master into the test-feature branch and check if everything is in order!

 $ git pull origin master # test more 
+5
source

First you need to get the branch:

 git fetch origin 

Then you can list all the files that have been changed:

 git diff --name-only origin/master 
+3
source

As some suggested, you can check the thread in the question. You can also receive the receive request itself, as described here by Github.

I created a tool that automatically deploys all receive requests to unique temporary testing URLs on your own server, which can be convenient if you want your quality control team to test requests without having to have a development environment for each of them. cars.

0
source

Source: https://habr.com/ru/post/1265839/


All Articles