I have a repository on github and a teammate forked it, now he sent me a pull request so what should I do to resolve the conflicts? I am on master branch so what commands should I write?
Asked
Active
Viewed 1,079 times
1
-
resolve the conflicts if any and commit again. – Sudhansu Bhatta May 28 '20 at 03:44
-
yes I know but what should I do to resolve conflicts? – Maha May 28 '20 at 03:45
-
1when you pulled you should see the file list with conflicts. Open them in your editor and if the editor supports merge conflicts then do it that way else you have to do it manually. When you open the files you will see the code markings. – Sudhansu Bhatta May 28 '20 at 03:50
-
1Please see this https://www.grandcircus.co/blog/resolving-git-conflicts/ – Sudhansu Bhatta May 28 '20 at 03:51
2 Answers
2
You can use the gh CLI (command Line Interface) for GitHub
That allows you to merge it directly: gh pr merge xxx
If there is any merge conflict, the merge will fail.
At this point, you can checkout locally the PR branch: gh pr checkout xxx
Then merge the local pr branch to your target branch (master
):
git switch master
git merge patch-x
Resolve any conflict (see GitHub tutorial or OReilly), and push the result to your remote repository.

VonC
- 1,262,500
- 529
- 4,410
- 5,250
0
please following below step::
git branch ,
git checkout branchname,
git switch master,
git merge patch-x,

VIVEKA
- 11
- 1
-
Yes, but how do you get the patch-x branch? That is what my answer details. – VonC May 28 '20 at 05:30
-
-
Indeed, although these day, you would use git switch, not git checkout: https://stackoverflow.com/a/57066202/6309 – VonC May 29 '20 at 13:12