我向计算机上的主分支添加了一个标记:

git tag mytag master

如何将其推送到远程存储库?运行git push会显示以下消息:

一切都是最新的

但是,远程存储库不包含我的标记。


当前回答

标记不会通过git push命令发送到远程存储库。我们需要使用以下命令将这些标记显式发送到远程服务器:

git push origin <tagname>

我们可以使用以下命令一次推送所有标签:

git push origin --tags

以下是有关git标记的完整详细信息的一些资源:

http://www.cubearticle.com/articles/more/git/git-tag

http://wptheming.com/2011/04/add-remove-github-tags

其他回答

您可以通过简单的gitpush--tags命令推送所有本地标记。

$ git tag                         # see tag lists
$ git push origin <tag-name>      # push a single tag
$ git push --tags                 # push all local tags 

要推送单个标记,请执行以下操作:

git push origin <tag_name>

以下命令应推送所有标签(不推荐):

# not recommended
git push --tags

我做了这样的事情:

git push --tags origin <branch-name> <tag-name>

e.g. : git push --tags origin master v2.0

您可以像git push一样推送标记--tags

标记不会通过git push命令发送到远程存储库。我们需要使用以下命令将这些标记显式发送到远程服务器:

git push origin <tagname>

我们可以使用以下命令一次推送所有标签:

git push origin --tags

以下是有关git标记的完整详细信息的一些资源:

http://www.cubearticle.com/articles/more/git/git-tag

http://wptheming.com/2011/04/add-remove-github-tags