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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Test a pull request from a private repo before merging

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

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

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
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,886 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you