简体   繁体   中英

How to merge pull request conflicts when pull request is from a forked repo?

I have run into this situation where a coworker forked a repo and made some changes and commited and pushed into git and created a pull request for me. We are using Stash from Atlassian and when I try to merge the pull request I get message to resolve the conflicts first.

Normally if there was conflict during pull or merge into a branch, I would be on the branch into which I have to pull/merge and resolve the conflict and commit and push.

Now that my coworker has forker the repo, I do not have permission to his repo and I am on the main repo. How to go about merge the pull request conflict from his forked repo to the main one ?

thanks
Nohsib

Refer to Resolve a pull request with conflicts and Manually pull requests to your local system .

  1. Pull the changes to your local repository
  2. Resolve them
  3. Merge
  4. Push (then, the pull request is marked as accepted)

You can use below steps:

  1. Clone main repo into your localbox
  2. Go to branch on which pull request has been raised

For above use below

git clone <clone_url> -b <branch_name>

Run below command

git fetch --quiet --no-tags --progress <clone_url> +refs/pull-requests/<PR_NUMBER>/merge:refs/remotes/stash-pull-requests/<PR_NUMBER>

Now you can see the conflicts and resolve them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM