코딩스토리

[Git] git에서 특정 Branch만 clone하는 방법 본문

Git

[Git] git에서 특정 Branch만 clone하는 방법

라크라꾸 2020. 7. 4. 02:51

보통 git을 사용할 때 브런치의 코드를 가져오고 싶다면, 기본적으로 가장 상위(master)브런치를 받고 나서 checkout을 통해 브런치를 이동하게 됩니다. 이 과정을 생략하고, 처음부터 특정 브런치를 복제하고 싶을 경우 사용하는 방법입니다.

 

 

git clone -b <branch-name> --single-branch <저장소 URL>
ex) git clone -b develop --single-branch https://github.com/lakue119/LakuePopupActivity.git

 

Comments