How to git clone a specific tag

后端 未结 5 1108
误落风尘
误落风尘 2020-11-28 18:03

From git-clone(1) Manual Page

--branch can also take tags and detaches the HEAD at that commit in the resulting repository.

5条回答
  •  迷失自我
    2020-11-28 18:47

    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    
    

    Will be faster than :

    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
    

    Or

    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
    

提交回复
热议问题