git-브랜치만-clone하기

1-리포지토리의 모든 브랜치 패치 후 특정 브랜치로 전환

git clone --branch <branchname> <remote-repo-url> .

or

git clone -b <branchname> <remote-repo-url> .

예시

git clone -b main https://github.com/qwerewqwerew/github.git .

2-특정 브랜치만 패치하고 다른 브랜치는 패치안함

git clone --branch <branchname> --single-branch <remote-repo-url> .

or 

git clone -b <branchname> --single-branch <remote-repo-url> .

예시

git clone --branch main --single-branch https://github.com/qwerewqwerew/github.git .

댓글 남기기