Skip to main content

Resolving a merge conflict on GitHub

Resolve simple merge conflicts directly on GitHub using the conflict editor or handle complex cases via the command line.

You can resolve simple competing line change conflicts on GitHub. For other conflicts, use the command line. See Resolving a merge conflict using the command line.

If Copilot 클라우드 에이전트 is enabled for the repository, you can click Fix with Copilot in the merge box to have Copilot resolve conflicts automatically. See GitHub Copilot 클라우드 에이전트 사용.

경고

Resolving conflicts on GitHub merges the entire base branch into the head branch. If the head branch is the default or protected branch, you may be prompted to create a new head branch. See 보호된 분기 정보.

  1. 리포지토리 이름에서 Pull requests를 클릭합니다.

    리포지토리의 기본 페이지  스크린샷 가로 탐색 모음에서 "끌어오기 요청"이라는 레이블이 있는 탭이 진한 주황색 윤곽선으로 표시되어 있습니다.

  2. In the "Pull Requests" list, click the pull request with a merge conflict that you want to resolve.

  3. Near the bottom of your pull request, click Resolve conflicts.

    Screenshot of a warning that a pull request has a merge conflict. The "Resolve merge conflicts" button is outlined in dark orange.

    참고

    If Resolve conflicts is deactivated, resolve the conflict using another Git client or the command line. See Resolving a merge conflict using the command line.

  4. 분기의 변경 내용만 유지하거나, 다른 분기의 변경 내용만 유지하거나, 두 분기의 변경 내용을 통합할 수 있는 완전히 새로운 변경을 수행할지 결정합니다. 충돌 표식 <<<<<<<, =======, >>>>>>>를 삭제하고 최종 병합에서 원하는 대로 변경합니다.

  5. If your file has more than one merge conflict, scroll down to the next set of conflict markers and repeat steps four and five to resolve the conflict.

  6. After you've resolved all the conflicts in the file, click Mark as resolved.

    Screenshot of the editor to resolve a merge conflict in a pull request. The "Mark as resolved" button is outlined in dark orange.

  7. If more than one file has a conflict, select the next file you want to edit on the left side of the page under "conflicting files" and repeat steps four through seven until you've resolved all merge conflicts in your pull request.

  8. After you've resolved all your merge conflicts, click Commit merge. This merges the entire base branch into your head branch.

    Screenshot of the editor to resolve a merge conflict in a pull request. The "Commit merge" button is outlined in dark orange.

  9. If prompted, review the branch that you are committing to. You can update the head branch or, if available, create a new branch for the pull request. If the head branch is protected, you must create a new branch.

    Click Create branch and update my pull request or I understand, continue updating BRANCH.

  10. To merge your pull request, click Merge pull request. See 끌어오기 요청 병합.

Further reading