[Git] branch 생성 & remote branch 연동

하운·2023년 6월 8일
0

Git

목록 보기
1/3

local branch 생성

git branch [branch name]

사용 할 branch 체크아웃

checkout은 Git에서 브랜치를 전환하는데 사용되는 명령입니다. 현재 작업 중인 브랜치를 변경하고 해당 브랜치의 최신 커밋을 작업 디렉토리로 가져옵니다.

git checkout [branch name]

remote branch 목록 보기

git branch -r

생성한 local branch를 서버에 추가

git push origin [branch name]

local branch, remote branch 연동

생성된 branch는 각자가 local 및 remote 저장소에 따로 존재해서 다음의 명령어로 서로 연동해 줘야 합니다.

git branch --set-upstream-to origin/[branch name]
profile
Full-Stack 개발자 꿈나무

0개의 댓글