본문 바로가기

Python_Beginer/GIT

[GIT]3 way merge - P4Merge

반응형

1. Merge 작업 [ Confilict 상태 ]

https://developer-ankiwoong.tistory.com/784

 

[GIT]2 way merge and 3 way merge

[ 기본 구조 ] Base A B C D [ BASE 버전관리를 위해 Branch1 / Branch2를 생성 ] Branch1 Base Branch2 A A A B B B C C C D D D [ 각 Branch의 내용을 수정 ] Branch1 Base A A A H B B C C T H D T [ Branch1..

developer-ankiwoong.tistory.com

$ cd document
$ cd git
$ git init confilict
$ cd confilict
$ vim work.txt
$ git add work.txt
$ git commit -m "ABCD"
$ git branch branch1
$ git checkout branch1
$ vim work.txt
$ git commit -am "AHCH"
$ git log --all --graph --oneline
$ git checkout master
$ git branch branch2
$ git checkout branch2
$ vim work.txt
$ git commit -am "ABTT"
$ git log --all --graph --oneline
$ git checkout branch1
$ git merge branch2

 

2. P4Merge 설치

https://www.perforce.com/ko/jepum/helix-core-apps/merge-diff-tool-p4merge

 

Helix Merge and Diff Tools (P4Merge) | Perforce

특정 시간대에 변경된 사항을 알아야합니까? Folder Diff가 두 시점 사이에 브랜치와 폴더 내역을 표시합니다. 지속적인 통합 버그를 진단하는 데 유용한 도구 인 Folder Diff는 보류중인 병합 시나리오에서 해결해야 할 코드의 양도 측정합니다. 수정된 파일, 고유한 파일 또는 변경되지 않은 파일 제외이름 또는 확장명으로 파일 필터링친숙한 파일/폴더 계층에서 수정된 자산 구성 

www.perforce.com

 

전체 설치가 아니라 P4Merge만 선택 후 설치

 

3. P4Merge 전역설정(Global)

$ git config --global merge.tool p4merge
$ git config --global mergetool.p4merge.path "C:/Program Files/Perforce/p4merge.exe"
$ git config --global mergetool.prompt false

 

4. P4Merge Config 확인

$ vim ~/.gitconfig

 

5. P4Merge

$ git mergetool

하단에 Confilict 부분이 나온다.

Confilict 부분은 수동으로 수정 후 저장 하고 종료

 

6. 확인 작업 및 커밋 작업

$ git status
$ cat work.txt.orig
$ cat work.txt
$ rm work.txt.orig
$ git commit
$ git log --all --graph --oneline

*   7324a8f (HEAD -> branch1) Merge branch 'branch2' into branch1
|\
| * fb8d879 (branch2) ABTT
* | 9c023d5 AHCH
|/
* d861ced (master) ABCD

 

반응형