如何使用Git将标签推送到远程存储库? [英] How to push a tag to a remote repository using Git?

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

问题描述

我已将克隆到我的笔记本电脑的远程Git存储库,然后我想添加一个标签,以便运行

  git标记mytag master 

当我运行 git tag 时我的笔记本电脑上显示了 mytag 标签。然后我想把它推送到远程仓库,所以我在所有的客户端都有这个标签,所以我运行 git push ,但是我收到了消息:


一切都是最新的


如果我去我的桌面并运行 git pull ,然后显示 git tag 没有标签。

我也尝试对项目中的某个文件进行小的更改,然后将其推送到服务器。之后,我可以将更改从服务器上拖到桌面计算机上,但在台式计算机上运行 git tag 时仍然没有标签。



如何将标签推送到远程存储库,以便所有客户端计算机都可以看到它?

>推送单个标记:

  git push origin< tag_name> 

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

  git push --tags 


I have cloned a remote Git repository to my laptop, then I wanted to add a tag so I ran

git tag mytag master

When I run git tag on my laptop the tag mytag is shown. I then want to push this to the remote repository so I have this tag on all my clients, so I run git push but I got the message:

Everything up-to-date

And if I go to my desktop and run git pull and then git tag no tags are shown.

I have also tried to do a minor change on a file in the project, then push it to the server. After that I could pull the change from the server to my Desktop computer, but there's still no tag when running git tag on my desktop computer.

How can I push my tag to the remote repository so that all client computers can see it?

解决方案

To push a single tag:

git push origin <tag_name>

And the following command should push all tags (not recommended):

git push --tags

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

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