git - 浏览 repo 中标记版本的列表?

标签 git

我正在尝试检查 OpenSSL 1.0.2a(而不是 Master)。 OpenSSL 已标记版本,我正在尝试浏览它们以确定实际名称是什么。我知道它们有 1.0.0、1.0.1 和 1.0.2(但它们的命名更复杂)。

根据 OpenSSL Git repository ,存储库位于 git://git.openssl.org/openssl.git。

根据 How to see all tags in a git repository in command line , 我需要使用 git 标签:

$ git tag git://git.openssl.org/openssl.git
fatal: Not a git repository (or any of the parent directories): .git

如何浏览 Git 存储库中保存的标记版本?


为了完整性,Git for beginners: The definitive practical guide不讨论这个话题。

最佳答案

git tag 假定您在本地 checkout 了该存储库的克隆。 (这就是为什么它提示不在 git 存储库中的原因。)

为了实现你想要的,你可能想先克隆它,然后切换到想要的标签:

git clone git://git.openssl.org/openssl.git
cd openssl
git tag -l                   # to list the tags
git checkout tags/<name>     # to switch to the desired tag

您还可以使用以下命令获取远程存储库中的标签列表,而无需先执行 git clone:

git ls-remote --tags git://git.openssl.org/openssl.git

关于git - 浏览 repo 中标记版本的列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29882263/

相关文章:

linux - 为什么这么多项目在 git 版本标签前加上 "v"?

git - Bitbucket 的 pull 请求模板

GIT,不要 merge 特定文件

Git:强制从特定分支 pull 出(并防止覆盖)

git - 使用 Git,显示*仅*存在于一个特定分支上的所有提交,而不显示*任何*其他分支上的所有提交

git - 如何使 Go 模块语义导入版本控制 v2+ 与虚导入路径一起工作

Github推送错误: unpack failed: index-pack abnormal exit

git - git中的树哈希存储在哪里?

linux - 将文件从一个用户复制到另一个权限问题

git - 直接跳转到 'git add -i' patch命令(5)