How do I clone/pull a pull request to a local repository from Bitbucket? I read this but I am somehow not able to find a handle to the pull request on Bitbucket that I can name on the command line. I do not have access to the contributor's fork but can see the issued pull request on the web interface. To be specific, I am using git.
PS: I posted this question on StackOverflow a few days ago but having not received any response came across this forum.
You need to fetch from origin and then you can create a new branch with changes.
Replace <no> with PR number:
$ git fetch origin pull/<no>/head $ git checkout -b pull-request FETCH_HEAD
Thanks for the quick response.
The problem is that I'm trying to automate this process using webhooks and the PR number is only specified (as the "ID" field) when the PR is created. I'm referring the documentation provided here which i confirmed upon testing.
On any other event(i'm only interested in PR updated after that) the PR "ID" field is not present which leave me with only the branch name to work with.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The ID is present in the data sent to the webhook url. Take a closer look at "Examples of POST data -> Created" from the link you provided.
As a side note. You supposed to add this as a comment to my answer, not as an answer by itself. If you still can, you should convert your answer to a comment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for posting the comment as the answer.
As I've mentioned in my previous comment, the ID is present in POST data->Created/CommentCreated/Comment Updated/Comment Deleted but not in POST data -> Updated/Merged/Declined which is what i'm looking for.
I'm guessing this should be an easy fix from an API point of view considering some of the API's for PR has this field and some don't
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, what can I do when I get those messages:
$ git fetch origin pull/3/head fatal: Couldn't find remote ref pull/3/head fatal: The remote end hung up unexpectedly
Sorry for a newbie question; however I cannot find the informattion how to pull the PR to my local computer anywhere. I do not think we should just click "merge" for a PR and wanna test it locally, how to do that, please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any updates on this? I'm having the same issue mentioned by Jaroslav. I do not have access to developers repositories, either.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The following worked for me, for checking out a pull request locally:
git fetch origin refs/pull-requests/<pull request number>/from:<new local branch name>
From there, you can do tests, merge this branch into another branch, etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm facing the same issue. Trying to fetch the Pull Request branch of a remote user locally gives 'access denied'
$ git fetch git@bitbucket.org:<remote_user>/<repo_fork> <PR_branch> repository access deined fatal: The remote end hung up unexpectedly
I don't understand why this should be happening if I can see the contents of PR using the web UI.
Thanks in advance for any help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The issue seems to be related to credentials. Can you verify your credentials?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.