
git config --global -e
- git bash에
git config --global -e
입력 > VSCode창 open
- VSCode에 하기 내용 입력
[merge]
tool = vscode
[mergetool "vscode"]
cmd = "code --wait $MERGED"


Git Merge
- 현재 위치한 Branch에 다른 Branch 병합

- main branch에 "my name is noma" 내용의 test.txt 파일 생성, add, commit


- dev branch에 "are you?"내용 추가하여 test.txt.파일 갱신, commit
- add를 생략하고 바로 commit할 수도 있습니다.

3. main branch 이동 후 git merge dev
입력 (dev branch merge)
4. test.txt파일이 "my name is noma /n and you?"로 갱신되어 있음.
Git Conflict
- Branch를 Merge하는 과정 또는 Push, Pull하는 과정에서 충돌이 있을 수 있음.

- main branch의 test.txt파일을 "hello, noma."로 갱신, commit


2. dev2 branch 생성
3. main branch의 test.txt파일을 "hello, zero."로 갱신, commit


- dev2 branch 이동
- dev2 branch의 test.txt파일을 "hello, base."로 갱신, commit

- main branch 이동
git merge dev2
입력 -> conflict 발생

Conflict 해결 후 Merge


git mergetool
입력
- VSCode 창에 충돌되는 파일 내용 출력됨

- 충돌되는 내용 하나로 정리, 저장, 닫기

4. git add test.txt
입력 후 git commit
입력
5. test.txt 조회시 hello, base 출력