Type something to search...

08 git 브랜치만 clone하기

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

1
git clone --branch <branchname> <remote-repo-url> .
2
3
or
4
5
git clone -b <branchname> <remote-repo-url> .

예시

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

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

1
git clone --branch <branchname> --single-branch <remote-repo-url> .
2
3
or
4
5
git clone -b <branchname> --single-branch <remote-repo-url> .

예시

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