3rd party pull request conflict

I have a conflict on a pull request submitted by another person. How to I go about fixing the conflict so I can merge the pull request? I have looked at the related questions but none of the suggestions seem to work. The Bitbucket help leads to:

https://confluence.atlassian.com/bitbucket/resolve-merge-conflicts-704414003.html

but this seems to be for a pull request submitted by me ( repo owner)? I'm new to this so I may be wrong here, but the first command fails, as there isn't a branch on the remote to pull, I'm after a pull request.

 

I have tried git pull origin pull-requests/9 but it can't find that. I have pulled using the full path for pull-requests/9 which seems to work "* branch            HEAD       -> FETCH_HEAD" but then it says already up to date and git diff master gives no changes.

any help greatly appreciated.

1 answer

1 accepted

Accepted Answer
0 votes

Irrespective of who created the Pullrequest, you can resolve the conflicts as long as you have 'write' access on the repo. 

You need to fetch the source and target branch to your local before resolving the conflict. Not the pull request. Once the source branch is checked out, you can merge the target into it and you will then see the same conflict locally. Then you resolve the conflict and push to remote. The pull request will be automatically updated.

ahaa, and thanx for your prompt response.

How do I fetch a branch from another persons forked repo? If I hover over the pull request the link I get is the pull request in my repo. The source branch is shown but how do I get the full path to the other persons forked repo? Do I have to email them and ask?

git checkout branch-name gives me error:pathspec.

sorry to be so dumb, first time smile

An option is to name the fork with a remote label and use it. See http://stackoverflow.com/questions/38949951/how-to-solve-merge-conflicts-across-forks for more details. 

You can also use the full url and branch name as mentioned at https://help.github.com/articles/merging-an-upstream-repository-into-your-fork/

I thought I had tried using the full path, obviously not.

The links talk about me not having access to the main repo, but my situation is the other way around. I'm trying to fix conflicts in a pull request someone else has pushed to my repo. I read a thread saying the pull requester should fix the conflicts, which I guess is a work around.  I'll have to have another look at it. So much to learn smile

thanx again for your time.

 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

2,408 views 9 12
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you