mergetool을 vscode로 설정하기

부가 설명
conflict 났을 때 merge과정을 쉽게 하기 위해서 vscode로 수정하자
Tags
merge
tool
config
 

~/.gitconfig 파일 수정하기

$ git config --global -e
위 명령어를 통해 바로 글로벌 config 파일 수정 가능하다.
 
아래 문구들을 추가하면 된다.
[merge] tool = vscode [mergetool "vscode"] cmd = code --wait $MERGED [diff] tool = vscode [difftool "vscode"] cmd = code --wait --diff $LOCAL $REMOTE
notion image

충돌상황 해결하기

$ git mergetool
위 명령어를 통해 vscode를 이용하여 충돌나는 부분을 수정할 수 있다.
notion image

conflict 난 부분 확인하기

충돌난 부분은 Unmerged 상태로 표시된다. 하단 그림의 빨간색 부분이 충돌난 부분이다.
$ git status
notion image