개요

Tortoisegit 은 TortoiseSvn에 비해 완성도가 떨어져 보이고 제일 괜찮아 보이는 Smartgit 은 오픈 소스에 쓸때를 제외하고는 상용이라 그냥 command 용 git 을 사용하기로 하였다.

 

대신 diff 와 merge를 command 에서 하면 불편하므로 Beyond compare 를 쓸수 있게 설정 하는 방법을 정리해 본다.

Beyond Compare 3 기준이며 git 은 1.7.6 이상이어야 함.

 

설정

Windows용 Bash 에서 git 을 사용할 경우 아래 내용중 $ 문자는 앞에 \ 문자를 추가해 주어야 한다. cmd.exe 나 JPSoft 의 Take Commander 는 $ 만 사용해도 된다.

Diff 

  1. git 의 전역 설정의 diff 툴을 변경한다.

    git config --global diff.tool bc3
    CODE
  2. bc3 의 path 를 설정

     git config --global difftool.bc3.path "c:/program files/beyond compare 3/bcomp.exe"
    CODE

    Windows 64면 경로 변경

    Windows 64 bit 면 경로에 (x86) 추가

     git config --global difftool.bc3.path "c:/program files (x86)/beyond compare 3/bcomp.exe"
    CODE
  3. 기본적으로 tool 을 띄울때 마다 "Launch 'bc3' [Y/n]:" prompt 가 뜨고 엔터키를 쳐야 하니 prompt 를 끈다.

    git config --global --add difftool.prompt false
    git config --global --add mergetool.prompt false
    CODE
  4. BC3 로 diff 를 하려면 cmd 에서 다음 명령어 실행

    git difftool myfile.java
    CODE

    여러 개의 파일이 변경되었을 경우 BC3 가 파일마다 뜨게 된다. -d(--dir-diff) 옵션을 주면 directory 구조를 표시하므로 여러 개를 비교할 경우 편리하다.

3-way Merge

  1. git 의 전역 설정의 diff 툴을 변경한다.

    git config --global merge.tool bc3
    CODE
  2. bc3 의 path 를 설정

     git config --global mergetool.bc3.path "c:/program files/beyond compare 3/bcomp.exe"
    CODE

    Windows 64면 경로 변경

    Windows 64 bit 면 경로에 (x86) 추가

     git config --global mergetool.bc3.path "c:/program files (x86)/beyond compare 3/bcomp.exe"
    CODE
  3. BC3 로 merge 를 하려면 cmd 에서 다음 명령어 실행

    git mergetool myfile.java
    CODE

 

같이 보기

 

Ref