GIT从特定标签中拉/取 [英] GIT pull/fetch from specific tag

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

问题描述



我知道在克隆后,我可以签出标签,但是它是可能在拉动过程中指定一个标签?



在ClearCase中,我可以重新绑定或提供特定的代码基准,是否有一种方法可以使用类似git标签/推码到指定的标签?

解决方案

这与ClearCase有点不同,因为您只能重新生成基线在父Stream上(尽管您可以将任何Stream中的任何基线传递到Stream)。

因此,您对ClearCase进行的合并有一些限制。



使用Git,您可以将任何提交合并到当前分支的 HEAD 中。

如果该提交来自远程回购,它将首先导入本地仓库的远程分支( fetch '部分 git pull )然后合并。

  git pull [options] [< repository> [< refspec> ...]] 

refspec $ b


< refspec> code>可以为任意的远程参考(例如,标签的名称)或者甚至是具有相应远程跟踪分支的参考集合(例如, refs / heads /:refs / remotes /原始/ ),但通常它是远程仓库中分支的名称。 如何使用指定的提交ID拉远程分支?


Is there a way to pull/fetch code from a specific tag in a repo.

Am aware that after clone, i can checkout to the tag but is it possible to specify a tag during a pull?

In ClearCase i can rebase or deliver a specific baseline of code, is there a way where i can use git tags similarly to pull/push code upto a specified tag?

解决方案

It will be a bit different with ClearCase, because you can only rebase a baseline produced on the parent Stream (although you can deliver any baseline from any Stream to your Stream).
So there are some limitations to the kind of merge you do with ClearCase.

With Git, you can merge any commit to the HEAD of your current branch.
If that commit comes from a remote repo, it will be first imported in the remote branches of your local repo ('fetch' part of the git pull) and then merged.

 git pull [options] [<repository> [<refspec>…]]

The "refspec" part of the git pull command means you can pull anything.

<refspec> can name an arbitrary remote ref (for example, the name of a tag) or even a collection of refs with corresponding remote tracking branches (e.g., refs/heads/:refs/remotes/origin/), but usually it is the name of a branch in the remote repository.

See also How to pull remote branch with specified commit id?

这篇关于GIT从特定标签中拉/取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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