본문 바로가기
Infra/Git

브랜치 병합, 충돌 해결

by 골든크랩 2022. 8. 22.
728x90
반응형

1. abc 브랜치로 이동

PS C:\Projects\GIT-TEST> git checkout  abc
Switched to a new branch 'abc'
PS C:\Projects\GIT-TEST> git branch
* abc
  add-style
  master

 

2. add-style 과 병합하기
PS C:\Projects\GIT-TEST> git merge add-style
Updating 0ad9d90..1464bc1
Fast-forward
 index.html | 3 ++-
 main.css   | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)
 create mode 100644 main.css
PS C:\Projects\GIT-TEST>

 

 

3. 브랜치간 충돌 (add-style과 abc 두 브랜치간의 충돌)

C:\Projects\GIT-TEST>git merge add-style
Auto-merging index.html
CONFLICT (content): Merge conflict in index.html
Automatic merge failed; fix conflicts and then commit the result.

<body>
<<<<<<< HEAD
    ABC!
=======
    ADD STYLE????
>>>>>>> add-style
</body>

해결책 : 수동으로 필요한것만 남기고, 필요없는건 지우면 됨.

 

 

 

 

 

 

728x90
반응형

'Infra > Git' 카테고리의 다른 글

원격 저장소 업로드  (0) 2022.08.22
버전 되돌리기  (0) 2022.08.22
브랜치 관리(생성,삭제,이동)  (0) 2022.08.22
버전 생성  (0) 2022.08.22
git 설치하기  (0) 2022.08.21

댓글