git clone 下载源码
git tag 列出所有版本号
git checkout +某版本号
你当前文件夹下的源码会变成这个版本号的源码。
但可能遇到错误:
error: Your local changes to the following files would be overwritten by checkout : xxxx
Please commit your changes or stash them before you switch branches
可以强制切换分支以舍弃修改,再checkout。
参考:
(23 封私信 / 80 条消息) 如何在 GitHub 下载某个程序的特定版本(代码)? - 知乎 (zhihu.com)
git 学习笔记 —— 保留/丢弃当前分支修改并切换至其他分支 - yhjoker - 博客园 (cnblogs.com)