민희의 코딩일지

[Git] branch의 이해, merge 본문

Git

[Git] branch의 이해, merge

heehminh 2022. 1. 21. 11:54
반응형

merge : 2개의 공간에서 개발된 코드를 하나의 branch로 합치는 것

- conflict 해결이 필요함

- 깃허브에서 merge 요청 -> pr(pull request)라고 함

 

git branch : 현재 생성되어있는 브랜치의 목록을 본다.

git branch 이름 : '이름'으로 branch가 만들어진다.

git checkout 이름 : '이름' branch로 이동이 된다.

* branch명 main에 'a' 'c' 를 commit 해놓은 상태

* branch명 gitrini에 'q'를 추가로 commit

-> gitrini에서 git log -> q c a

-> main에서 git log -> c a

 

git push origin main -> main branch를 push

git push origin gitrini -> gitrini branch를 push

 

merge하는 방식

pull request -> new pull request

base: main compare: gitrini

create pull request

merge 

 

반응형

'Git' 카테고리의 다른 글

Git 명령어 정리  (1) 2024.09.03
[Git] github와 git연동  (0) 2021.12.27
[Git] 로컬에서 Git을 통해 버전관리  (0) 2021.12.27
Comments