1. 레포지토리 clone

git clone "레포지토리 주소"

 

2. 원격에 있는 모든 브랜치 확인하기

git branch -r

 

3. 모든 브랜치 가져오기 (로컬에 생성)

git fetch --all

 

- 특정 브랜치만 가져오기

git fetch origin 가져올-브랜치명

 

4. 각 브랜치를 로컬에 체크아웃하기

git checkout -b 브랜치명 origin/브랜치명

 

 

(예시)

$ git checkout -b develope origin/develope                                      
branch 'develope' set up to track 'origin/develope'.
Switched to a new branch 'develope'

 

이제 로컬 브랜치 develope가 원격 브랜치 origin/develope와 연결되었다

 

이젠 main 에서 develope 브랜치로 이동하려면 아래만 입력하면된다.

git checkout develope

 

+ Recent posts