我如何提交一个git标签? [英] How do I commit a git tag?

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

问题描述

我已经成功地做出了承诺并将更改推送到中央git存储库。我现在意识到我想标记所有文件的当前版本。所以我这样做:

  git tag -a 0.5 

成功。但现在我尝试了一个 git push ,我被告知没有什么可提交的。 (注意, git tag >显示了标签0.5,如何将我的新标签推送到中央存储库?)

但只在本地)

解决方案

我认为你想要

  git push --tags 

这样,推送所有标签:)



当然有一些替代方案,这就是git和all(用您选择的repo替换原点):

  git push origin tag 0.5 

p>

  git push origin refs / tags / 0.5:refs / tags / 0.5 

请参阅 git-push(1)了解更多详情。 git ready 在其标记文章。


I have successfully made, committed, and pushed changes to a central git repository. I realize now that I want to tag the current version of all files. So I do:

git tag -a 0.5

That succeeds. But now I try a git push and I am told there's nothing to commit. How do I push my new tag to the central repository?

(Note that git tag shows the tag 0.5, but only locally)

解决方案

I think you want

git push --tags

as that, well, pushes all your tags :)

There are some alternatives of course, this being git and all (replace origin with your repo of choice):

git push origin tag 0.5

or

git push origin refs/tags/0.5:refs/tags/0.5

See git-push(1) for further details. "git ready" has some useful info in their tagging article as well.

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

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