用git子树检出特定的标签 [英] checkout a specific tag with git subtree

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

问题描述

我可以在子树中使用标签吗?特定问题之后:

我有一个包含外部存储库作为子树的git存储库。
我可以添加这个外部存储库并从这个回购中签出一个特定的分支。用 git subtree pull --prefix =< dir> --squash< remote> < branch> 所选分支的更新效果良好。

现在可以检出特定标签吗?我找不到有关子树中标签的一些信息...

解决方案

实际上,任何引用都应该起作用。

  git subtree pull -P< prefix> <库> < REF> 

其中< ref> 可以是一个SHA,标签或分支。基本上任何git都可以解析为提交。


Can I use tags in subtrees? Following a specific issue:

I have a git repository which includes an external repository as a subtree. I could add this external repository and checkout a specific branch from this repo. With git subtree pull --prefix=<dir> --squash <remote> <branch> the update from the selected branch works well.

Now is it possible to checkout a specific tag? I couldn't find some information about tags in subtrees...

解决方案

Actually any reference should work. The man page for subtree displays this.

git subtree pull  -P <prefix> <repository> <ref>

Where <ref> can be a SHA, tag or branch. Basically anything git can resolve to a commit.

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

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