How to git clone a specific tag

后端 未结 5 1105
误落风尘
误落风尘 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:37

    Use --single-branch option to only clone history leading to tip of the tag. This saves a lot of unnecessary code from being cloned.

    git clone  --branch  --single-branch
    

提交回复
热议问题