Skip to content

Instantly share code, notes, and snippets.

@marcysutton
Last active November 29, 2016 23:46
Show Gist options
  • Save marcysutton/df4ba9c6ec8f0f3e98dc9bb5b2b519b9 to your computer and use it in GitHub Desktop.
Save marcysutton/df4ba9c6ec8f0f3e98dc9bb5b2b519b9 to your computer and use it in GitHub Desktop.
Bitbucket merge hell

Merging a pull request

To apply a pull request, make sure your local develop branch is up to date. Then, create a new branch for that pull request:

git checkout -b some-user-feature

Run the following commands to apply all commits from that pull request on top of your branch's local history:

Bitbucket

curl -L https://bitbucket.org/api/2.0/repositories/dmusser/axe-core/pullrequests/85/patch | git am -3

Note: the above URL is behind authentication. And that seems to be the issue.

Github

curl -L https://github.com/dequelabs/axe-core/pull/205.patch | git am -3

In the Github UI, you can use the new Squash and Merge feature as an alternative.

If the merge succeeds, use git diff origin/develop to review all the changes that will happen post-merge.

@marcysutton
Copy link
Author

marcysutton commented Nov 29, 2016

curl -L -u user:app-password https://bitbucket.org/api/2.0/repositories/dmusser/axe-webdriverjs/pullrequests/9/patch | git am -3
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

@seancurtis
Copy link

I think the URL is wrong. I tried this and got the patch for a repo of mine (note api.bitbucket.org/2.0 instead of bitbucket.org/api/2.0 )

curl -L -u username:password https://api.bitbucket.org/2.0/repositories/dmusser/axe-core/pullrequests/85/patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment