简体   繁体   中英

How do I test a pull requests locally before merging from a forked version of my repo when I have different pull requests from different users

Well, I am a bit new to git.

I am working on a project with my team members, I created a git repo that has my source code. A team member makes a fork of my repo, makes some addition and then submits a pull request to my master branch.

I want to test this code first before merging it into my master branch, he created a topical branch named "additional-changes" for the pull request and maybe deletes the branch after submitting the request.

so I go this way

git checkout -b test origin/master

but I get errors.

So do I need to add a remote for this team member's branch first before checking it out? I get errors like the branch does not exist.

Please ignore my long stories and just give me a step by step procedure to handle a situation like this.

Thanks

Updated : It appears you can pull merge requests locally Git: How to checkout merge request locally, and create new local branch?

Add his forked project as a remote:

git remote <name_other_than_origin> <url>

Then you would do the following:

git fetch <name_of_forked_remote>
git checkout additional-changes

See How do I check out a remote Git branch? and Checkout branch on different remote .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM