merge란 git branch를 다른 branch로 합치는 과정을 말하며, 기본 단위는 branch이다.
git merge 명령어로는 commit 단위로 합치기가 불가능하다.
# branch 생성
$ git branch [브랜치이름]
# branch 이동
$ git checkout [브랜치이름]
# (작업 중인 branch 안에서 명령어 실행)
$ git add .
$ git commit -m "~~"
# 원격 저장소에 해당 branch가 이미 존재할 때
$ git push
# 원격 저장소에 해당 branch가 없을 때
$ git push origin [브랜치이름]
# (작업 중인 branch 안에서 명령어 실행)
$ git checkout main
# (master branch 안에서 명령어 실행)
# origin master 생략 가능
$ git pull origin master
# (작업 중인 브랜치 안에서 명령어 실행)
$ git merge master
$ git push