git clone 指定分支/指定commit

方法一

  • 下载整个branch及历史记录,文件较大,耗时
git clone --depth 1 [git-url] -b [branch-name]
git reset --hard [commit-number]

commit-number 在GitHub网页上可以找到:

方法二:

  • 下载zip,没有多余文件
posted @ 2022-05-12 11:55  levylaw  阅读(2639)  评论(0编辑  收藏  举报