Notice
Recent Posts
Recent Comments
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

Chimy's Program

GIT Branch - 3 way merge with tool 본문

GIT

GIT Branch - 3 way merge with tool

chimy 2020. 4. 1. 23:08

GIT Branch 3 way merge with tool

 

외부 도구(p4Merge)를 이용하여 병합하기 

 

 

새저장소를 생성하여 이동합니다

 

 

work.txt파일을 생성하고 버전을 만듭니다

 

 

here 브랜치와 there 브랜치를 생성하고 here 브랜치로 이동하여 work.txt파일을 수정한 뒤 버전을 만듭니다

 

 

there 브랜치도 똑같이 파일을 수정하고 버전을 만듭니다

 

 

here 브랜치에서 there 브랜치와 병합해줍니다

이때 발생하는 충돌을 편리하게 해결하기 위해 툴을 사용하려고 합니다

 

 

https://www.perforce.com/downloads/visual-merge-tool

 

Download Helix Visual Merge Tool Today | Perforce

Helix Visual Merge Tool (P4Merge) is a three-way merging and side-by-side file comparison tool. Use it to visualize your merges, obtain comprehensive file history, and compare a broad range of image files. Download the tool to get started.

www.perforce.com

자신의 컴퓨터에 맞는 운영체제를 선택하여 p4Merge tool을 다운로드합니다

 

 

p4Merge 설치하기

 

p4Merge 설치하기

p4Merge 설치하기 https://www.perforce.com/downloads/visual-merge-tool Download Helix Visual Merge Tool Today | Perforce Helix Visual Merge Tool (P4Merge) is a three-way merging and side-by-side file..

chim2.tistory.com

 

 

p4Merge를 설치했으니 git과 연결합니다

windows 버전 설정 명령어로 mac 등 다른 운영체제에서는 다른 명령어를 사용합니다

 

Windows git에 p4Merge 연결하기
git config --global diff.tool p4merge
git config --global difftool.p4merge.path 'C:\Program Files\Perforce\p4merge.exe'

git config --global merge.tool p4merge
git config --global mergetool.p4merge.path 'C:\Program Files\Perforce\p4merge.exe'

 

 

git mergetool 명령어로 편집도구를 불러옵니다

LOCAL : 현재 Branch / BASE : 공통의 부모 / REMOTE : 합병하려는 Branch

 

 

충돌이 발생한 부분을 편집 후 저장(Ctrl+S)한 뒤 툴을 닫습니다

 

 

편집한 파일을 자동으로 add까지 된 상태를 확인할 수 있습니다

 

 

수정된 내용이 확실하다면 백업된 불필요한 파일들을 제거해줍니다

 

※ git clean -f : untracked file 목록을 지우는 명령어

※ git clean -fd : untracked file 목록에서 디렉토리까지 지우는 명령어

 

 

버전을 생성하며 버전에 대한 정보를 확인합니다

 

 

병합이 잘됐는지 확인합니다

'GIT' 카테고리의 다른 글

GIT Branch 더 알아볼 주제  (0) 2020.04.03
p4Merge 설치하기  (0) 2020.04.02
GIT Branch merge 3 - 같은 파일 같은 부분 병합  (0) 2020.03.31
GIT Branch merge 2 - 같은 파일 다른 부분 병합  (0) 2020.03.30
GIT Branch merge  (0) 2020.03.30
Comments