파일의 같은 위치에 다른 내용이 입력된 상황
git branch conflict-1 실행
git branch conflict-2 실행
Tigers의 manager를 Kenneth로 변경
Leopards의 coach를 Nicholas로 변경
Panthers의 coach를 Shirley로 변경
→ 커밋 메시지: Edit Tigers, Leopards, Panthers
Tigers의 manager를 Deborah로 변경
→ 커밋 메시지: Edit Tigers
Leopards의 coach를 Melissa로 변경
→ 커밋 메시지: Edit Leopards
Panthers의 coach를 Raymond로 변경
→ 커밋 메시지: Edit Panthers
merge는 여러 파일의 충돌이 한번에 떠서 한 commit 에 넣어줌
git switch main 실행
git merge conflict-1 입력 → 충돌 발생
당장 해결이 어려운 경우 아래 명령어로 merge 중단
git merge --abort
해결 가능 시 충돌 부분 수정 후
git add.
git commit
으로 병합 완료
rebase는 브랜치에 있는 커밋 마다 충돌을 각각 처리
git switch conflict-2 실행
git rebase main 입력 → 충돌 발생
git status 입력
당장 해결이 어려운 경우 아래 명령어로 merge 중단
git merge --abort
해결 가능 시 충돌 부분 수정 후
git add.
git rebase --continue
→ 충돌이 모두 해결될 때까지 반복
git switch main 입력
git merge conflict-2 로 마무리 해 뒤쳐져 있는 메인을 가져옴
git branch -d conflict-1
git branch -d conflict-2
실행으로 마무리