Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apply Bitbucket pull request as a patch

I've got a repo on Bitbucket that only I have write access to.

Someone forked that repo, made changes and issued a pull request to my repo from the fork.

How can I get that pull request as a git patch to apply temporarily to my repo for testing purposes?

The forked repo is private so I can't pull it down, and I wouldn't want to do that anyway.

On GitHub you can simply go to a pull request and add a .patch to the end of the url to download the patch. This doesn't work with Bitbucket.

like image 507
Nick Spiers Avatar asked Oct 18 '13 18:10

Nick Spiers


1 Answers

For 7.x versions you might try these links based on info from https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.wadl and https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-git-rest.html:

Pull requests: https://bitbucket.example.com/rest/api/1.0/projects/GROUP/repos/PROJECT/pull-requests/ID.patch

Commits: https://bitbucket.example.com/rest/api/1.0/projects/GROUP/repos/PROJECT/patch?until=COMMIT (the since= query parameter can also be tried for a starting commit).

like image 145
Lekensteyn Avatar answered Sep 19 '22 05:09

Lekensteyn