Programing

특정 태그를 git clone하는 방법

lottogame 2020. 6. 23. 07:38
반응형

특정 태그를 git clone하는 방법


에서 자식-클론 (1) 매뉴얼 페이지

--branch 결과 리포지토리의 커밋에서 태그를 가져와 HEAD를 분리 할 수도 있습니다.

나는 시도했다

git clone --branch <tag_name> <repo_url>

그러나 작동하지 않습니다. 다음을 반환합니다.

warning: Remote branch 2.13.0 not found in upstream origin, using HEAD instead

이 매개 변수를 사용하는 방법?


git clone --branch <tag_name> <repo_url>

이 명령은 git 1.7.9.5에서 지원되지 않습니다.

git 1.8.3.5를 사용하고 작동합니다.


태그 끝으로 이어지는 기록 만 복제 하려면 --single-branch옵션을 사용하십시오 . 이렇게하면 불필요한 코드가 많이 복제되지 않습니다.

git clone <repo_url> --branch <tag_name> --single-branch

git clone -b 13.1rc1-Gotham  --depth 1  https://github.com/xbmc/xbmc.git
Cloning into 'xbmc'...
remote: Counting objects: 17977, done.
remote: Compressing objects: 100% (13473/13473), done.
Receiving objects:  36% (6554/17977), 19.21 MiB | 469 KiB/s    

보다 빠를 것입니다 :

git clone https://github.com/xbmc/xbmc.git
Cloning into 'xbmc'...
remote: Reusing existing pack: 281705, done.
remote: Counting objects: 533, done.
remote: Compressing objects: 100% (177/177), done.
Receiving objects:  14% (40643/282238), 55.46 MiB | 578 KiB/s

또는

git clone -b 13.1rc1-Gotham  https://github.com/xbmc/xbmc.git
Cloning into 'xbmc'...
remote: Reusing existing pack: 281705, done.
remote: Counting objects: 533, done.
remote: Compressing objects: 100% (177/177), done.
Receiving objects:  12% (34441/282238), 20.25 MiB | 461 KiB/s

명령을 사용하십시오

git clone --help

자식이 명령을 지원하는지 확인

git clone --branch tag_name

그렇지 않은 경우 다음을 수행하십시오.

git clone repo_url 
cd repo
git checkout tag_name

참고 URL : https://stackoverflow.com/questions/20280726/how-to-git-clone-a-specific-tag

반응형