简体   繁体   English

获取最新的稳定版git

[英]Get latest stable version git

I use git clone https://github.com/git/git.git to clone locally and subsequently install git program. 我使用git clone https://github.com/git/git.git在本地克隆,然后安装git程序。 Unfortunately when the install procedure end, the version of the software is 2.12.0.rc2.2g80ba04ed9 . 不幸的是,当安装过程结束时,该软件的版本是2.12.0.rc2.2g80ba04ed9

How to clone the latest stable version instead of a Release Candidate? 如何克隆最新的稳定版本而不是Release Candidate?

Releases are marked with tags. 版本标记有标签。 Just check out the latest stable one, and build as you normally did. 只需查看最新的稳定版,然后按照惯例进行构建。 The current latest stable build is 2.11.1: 目前最新的稳定版本为2.11.1:

$ git checkout v2.11.1

For a more general approach, you could use git tag and some shell scripting to deduce the latest stable tag automatically: 对于更通用的方法,您可以使用git tag和一些shell脚本来自动推导出最新的稳定标记:

$ git checkout `git tag | sort -V | grep -v "\-rc" | tail -1`

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM