git clone한 뒤 리모트 브랜치 로컬로 가져오기

LeeWonjin·2023년 4월 17일
0

문제해결

목록 보기
15/21
  1. 레포지토리 가져오기
git clone https://github.com/~~/reponame.git
cd reponame.git
  1. 리모트 브랜치 조회하기
git branch -r

	origin/브랜치1
    origin/브랜치2
    origin/브랜치3
  1. 모든 브랜치 조회하기
git branch -a
	
    remotes/origin/브랜치1
    remotes/origin/브랜치2
    remotes/origin/브랜치3
  1. 리모트 브랜치를 로컬 브랜치로 만들어 추적하기
    예를 들어, 리모트에 있는 브랜치2를 로컬에서 추적하고 싶다면
git branch -t origin/브랜치2

혹은, 로컬에서 추적한 뒤에 바로 체크아웃 하고 싶다면

git checkout -t origin/브랜치2
profile
노는게 제일 좋습니다.

0개의 댓글