使用Git下载特定标签 [英] Download a specific tag with Git

查看:273
本文介绍了使用Git下载特定标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何下载Git仓库的特定标签 - 它是当前版本的一个版本。



我看到有一个标签为git网页上的旧版本,对象名称为长十六进制数字。



但根据网站的版本名称是标记版本1.1.5



我尝试了一个像这样的命令(名称已更改):

  git clone http:/ /git.abc.net/git/abc.git my_abc 

我确实得到了一些东西 - 一个目录,一堆子目录等。

如果它是整个存储库,我如何获得我正在寻找的版本?如果不是,我该如何下载该特定版本? $ git clone
code>

会为您提供整个存储库。



克隆完成后,您可以使用 $ git tag -l <​​/ code>列出标签,然后签出特定的标签:

  $ git checkout tags /< tag_name> 

更好的办法是签出并创建一个分支(否则您将位于以修订号命名的分支上):
$ b

  $ git checkout tags /< tag_name> -b< branch_name> 


I'm trying to figure out how I can download a particular tag of a Git repository - it's one version behind the current version.

I saw there was a tag for the previous version on the git web page, with object name of something long hex number.

But the version name is "Tagged release 1.1.5" according the site.

I tried a command like this (with names changed):

git clone http://git.abc.net/git/abc.git my_abc

And I did get something - a directory, a bunch of subdirectories, etc.

If it's the whole repository, how do I get at the version I'm seeking? If not, how do I download that particular version?

解决方案

$ git clone

will give you the whole repository.

After the clone, you can list the tags with $ git tag -l and then checkout a specific tag:

$ git checkout tags/<tag_name>

Even better, checkout and create a branch (otherwise you will be on a branch named after the revision number of tag):

$ git checkout tags/<tag_name> -b <branch_name>

这篇关于使用Git下载特定标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆