{"meta":{"title":"Git 다시 지정 후 병합 충돌 해결","intro":"git rebase 작업을 수행할 때 일반적으로 커밋을 이동합니다. 이로 인해 병합 충돌이 발생하는 상황이 생길 수 있습니다. 즉, 커밋 중 두 개에서 동일한 파일의 동일한 줄을 수정했으며 Git에서 적용할 변경 내용을 알지 못한다는 의미입니다.","product":"시작하기","breadcrumbs":[{"href":"/ko/get-started","title":"시작하기"},{"href":"/ko/get-started/using-git","title":"Git 사용"},{"href":"/ko/get-started/using-git/resolving-merge-conflicts-after-a-git-rebase","title":"리베이스 후 충돌 해결"}],"documentType":"article"},"body":"# Git 다시 지정 후 병합 충돌 해결\n\ngit rebase 작업을 수행할 때 일반적으로 커밋을 이동합니다. 이로 인해 병합 충돌이 발생하는 상황이 생길 수 있습니다. 즉, 커밋 중 두 개에서 동일한 파일의 동일한 줄을 수정했으며 Git에서 적용할 변경 내용을 알지 못한다는 의미입니다.\n\n`git rebase`를 사용하여 커밋을 다시 정렬하고 조작한 후 병합 충돌이 발생하면 Git은 터미널에 다음 메시지를 출력하여 알려줍니다.\n\n```shell\nerror: could not apply fa39187... something to add to patch A\n\nWhen you have resolved this problem, run \"git rebase --continue\".\nIf you prefer to skip this patch, run \"git rebase --skip\" instead.\nTo check out the original branch and stop rebasing, run \"git rebase --abort\".\nCould not apply fa39187f3c3dfd2ab5faa38ac01cf3de7ce2e841... Change fake file\n```\n\n여기서 Git은 충돌을 일으키는 커밋을 알려 줍니다(`fa39187`). 다음 세 가지 옵션이 제공됩니다.\n\n* `git rebase --abort`를 실행하여 리베이스를 완전히 실행 취소할 수 있습니다. Git은 `git rebase` 호출 이전의 분기 상태로 되돌립니다.\n* `git rebase --skip`을 실행하여 커밋을 완전히 건너뛸 수 있습니다. 즉, 문제가 있는 커밋에 의해 도입된 변경 내용은 포함되지 않습니다. 이 옵션을 선택하는 경우는 매우 드뭅니다.\n* 충돌을 해결할 수 있습니다.\n\n충돌을 해결하려면 [명령줄에서 병합 충돌을 해결하기 위한 표준 절차](/ko/pull-requests/how-tos/merge-and-close-pull-requests/resolving-a-merge-conflict-using-the-command-line)를 따를 수 있습니다. 완료되면 Git이 리베이스의 나머지를 계속 처리할 수 있도록 `git rebase --continue`를 실행해야 합니다."}