Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Test a pull request from a private repo before merging

Brent Kelly February 17, 2020

I am currently working on a project hosted on Bitbucket. My client is having another developer work on some other features in parallel so I gave that developer read access to my repo and he forked it. I do not have access to his fork.

 

He recently finished a feature and made a pull request to my master. Is there a way, prior to approving and merging his PR into my master, for me to actually pull the code in his PR down to test it if I don't have access to his repo?

1 answer

1 accepted

0 votes
Answer accepted
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 18, 2020

Hello @Brent Kelly,

Thanks for reaching out.

You can't clone that fork repo if it is private but you can pull a patch for your PR, then apply it to your repository – this way you'll reconstruct the changes suggested in that PR locally.

Here's the API endpoint to get the patch. If you need this just once and prefer to use your session authentication, you can call the API this way:

https://bitbucket.org/!api/2.0/... 

If you plan to use it on a regular basis or in a script, you'll need to call our API domain and use one of the supported authentication methods:

https://api.bitbucket.org/2.0/...

You can then apply a patch using git apply command, see relevant documentation for Git.

Hope this helps. Let me know if you have any questions.

Cheers,
Daniil

Brent Kelly February 18, 2020

That looks like it will work. I've already merged the pull request as there was a bit of a time crunch, but I'll try this when I get another one.

Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events