Search code examples
gitgithubvisual-studio-codemerge-conflict-resolution

resolving conflicts in pull request


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?


Solution

  • 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.