리눅스
[git 명령어] git clone
변군이글루
2021. 2. 18. 13:13
반응형
git clone
사용법: git clone [<옵션>] [--] <저장소> [<디렉터리>]
git clone https://github.com/anti1346/project1.git
$ git clone https://github.com/anti1346/project1.git
'project1'에 복제합니다...
remote: Enumerating objects: 64, done.
remote: Counting objects: 100% (64/64), done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 64 (delta 19), reused 38 (delta 9), pack-reused 0
오브젝트를 받는 중: 100% (64/64), 9.62 KiB | 3.21 MiB/s, 완료.
델타를 알아내는 중: 100% (19/19), 완료.
git에서 특정 브랜치만 clone하는 방법
test 브랜치 생성
git branch test
git checkout test
$ git checkout test
'test' 브랜치로 전환합니다
git add .
git commit -m "Initial commit"
$ git commit -m "Initial commit"
현재 브랜치 test
커밋할 사항 없음, 작업 폴더 깨끗함
git push -u origin test
$ git push -u origin test
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote:
remote: Create a pull request for 'test' on GitHub by visiting:
remote: https://github.com/anti1346/project1/pull/new/test
remote:
To https://github.com/anti1346/project1.git
* [new branch] test -> test
'test' 브랜치가 리모트의 'test' 브랜치를 ('origin'에서) 따라가도록 설정되었습니다.
728x90
특정 브랜치 clone
git clone -b {branch_name} --single-branch {remote_repoL}
git clone -b test --single-branch https://github.com/anti1346/project1.git
#git clone -b {branch_name} --single-branch {remote_repoL}
$ git clone -b test --single-branch https://github.com/anti1346/project1.git
'project1'에 복제합니다...
remote: Enumerating objects: 64, done.
remote: Counting objects: 100% (64/64), done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 64 (delta 19), reused 38 (delta 9), pack-reused 0
오브젝트를 받는 중: 100% (64/64), 9.62 KiB | 3.21 MiB/s, 완료.
델타를 알아내는 중: 100% (19/19), 완료.
728x90
반응형