leelee.log

(팁-git)remote branch local에 가져오는 방법 본문

읽어볼 자료 아카이빙

(팁-git)remote branch local에 가져오는 방법

leeleelee3264 2020. 3. 12. 20:03

https://cjh5414.github.io/get-git-remote-branch/

 

Git remote branch 가져오기

Jihun's Development Blog

cjh5414.github.io

 자주 사용하는 커맨드인데 매번 찾아서 아예 링크를 저장해둠. 일단 clone이나 pull을 하면 remote에 있는 master와 다른 브런치들을 몽땅 다 가져오는 모양이다. 그래서 local에 막 clone된거 찾아서 쓴다고 하기만 하면 된다.

 

1. git checkout -r

remote에 있는 remote 브런치들 리스트 보기

git checkout -a 는 remote와 local 모두에 있는 브런치를 보여준다고 한다. 신기한 커맨드의 세계.

 

2. git checkout -t 가져올 remote branch 이름

하면 이제 정식으로 local에 가져와서 사용을 할 수 있다.