如何查看远程标签? [英] How to see remote tags?

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

问题描述

在Atlassian SourceTree中,如何知道哪些标签只是本地的,哪些标签也位于远程的?

In Atlassian SourceTree, how to know which tags are only local and which are also in remote?

创建标签时,您可以选择将标签推送到... ...",但是如何知道标签创建后是否已被推送?我可以在本地看到我的所有标签,但是我需要确保它们都位于远程位置,以便其他开发人员可以拉出它们.

When creating a tag you get the option "Push tag to: ...", but how to know if a tag has been pushed or not after it is created? I can see all my tags locally, but I need to be sure that they are present in remote so that other developers can pull them.

推荐答案

即使不进行克隆或获取,也可以使用

Even without cloning or fetching, you can check the list of tags on the upstream repo with git ls-remote:

git ls-remote --tags /url/to/upstream/repo

(如"中所示,在列出git-ls-remote时,为什么在标记名称后加"^{}"? a>")

(as illustrated in "When listing git-ls-remote why there's "^{}" after the tag name?")

xbmono 说明了

xbmono illustrates in the comments that quotes are needed:

git ls-remote --tags /some/url/to/repo "refs/tags/MyTag^{}"

请注意,您始终可以使用以下命令(git 1.8.3 +,2013年4月)在一个命令中推送提交标签:

Note that you can always push your commits and tags in one command with (git 1.8.3+, April 2013):

git push --follow-tags

请参见推送git commits&同时标记.

关于Atlassian SourceTree:

Regarding Atlassian SourceTree specifically:

请注意,来自

Note that, from this thread, SourceTree ONLY shows local tags.

SRCTREEWIN-4015 自2015年12月起.

There is an RFE (Request for Enhancement) logged in SRCTREEWIN-4015 since Dec. 2015.

一个简单的解决方法:

仅看到未按下标签的列表吗?

see a list of only unpushed tags?

git push --tags

git push --tags

或检查"Push all tags" 推送"框上的框对话框,所有标签将被推送到您的遥控器.

or check the "Push all tags" box on the "Push" dialog box, all tags will be pushed to your remote.

这样,您将确保它们位于远程位置,以便其他开发人员可以拉出它们".

That way, you will be "sure that they are present in remote so that other developers can pull them".

这篇关于如何查看远程标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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