如何提交 git 标签?

发布于 2024-07-17 17:23:37 字数 225 浏览 6 评论 0 原文

我已成功对中央 git 存储库进行、提交和推送更改。 我现在意识到我想标记所有文件的当前版本。 所以我这样做:

git tag -a 0.5

那就成功了。 但现在我尝试 git push 并被告知没有什么可以提交的。 如何将新标签推送到中央存储库?

(请注意,git tag 显示标签 0.5,但仅在本地)

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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

流年已逝 2024-07-24 17:23:37

我认为你想要

git push --tags

这样,嗯,推送你的所有标签:)

当然还有一些替代方案,这就是 git 和 all(用你选择的存储库替换 origin):

git push origin tag 0.5

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

参见 git-push(1) 了解更多详细信息。 “git Ready” 在他们的 标记文章。

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.

音盲 2024-07-24 17:23:37

git 1.8.3(4 月 22 日, 2013),尝试一下:

git push --follow-tags

当您推送新提交时,这些提交引用的任何标签也会被推送。
在您的情况下,已经推送的提交引用的任何标签也应该被推送。

这允许您在推送提交标签时始终使用一个命令。

Since git 1.8.3 (April 22d, 2013), try a:

git push --follow-tags

When you push new commits, any tag referenced by those commits would be pushed as well.
In your case, any tag referenced by a commit already pushed should be pushed too.

That allows you to always use one command when pushing commits and tags.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文