如何在 Bitbucket 中添加标签?我正在使用 Git

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8773422/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 12:40:18  来源:igfitidea点击:

How to add tags in Bitbucket? I'm using Git

gittagsbitbucket

提问by Georgie Porgie

I'm hosting my codes on Bitbucket using Git. My local client is EGit (eclipse plugin). I created a tag locally (Team -> Advanced -> Tag) and then pushed it to remote repository. But when I open my repository page, I can't find tags there. I'm pretty sure the tag can be seen locally.

我正在使用 Git 在 Bitbucket 上托管我的代码。我的本地客户端是 EGit(eclipse 插件)。我在本地创建了一个标签(团队 -> 高级 -> 标签),然后将其推送到远程存储库。但是当我打开我的存储库页面时,我在那里找不到标签。我很确定可以在本地看到该标签。

I'm not a Git expert. But it seems to me there are several types of tags in Git. Does Bitbucket only show certain types of tags?

我不是 Git 专家。但在我看来,Git 中有几种类型的标签。Bitbucket 是否只显示某些类型的标签?

回答by 4ndrew

Did you click the button "Add All Tags Spec" in Push Wizard in Eclipse? If not, try it. Or if you have access to console version of git just perform:

您是否在 Eclipse 的推送向导中单击了“添加所有标签规范”按钮?如果没有,请尝试一下。或者,如果您可以访问控制台版本的 git,只需执行:

git push --tags

回答by 030

This documentationindicates that a tag could be created. Based on that information the following command was constructed:

该文档表明可以创建标签。基于该信息,构建了以下命令:

git tag --annotate 1.0.0 --message "Initial version of some app"

and pushed by issuing:

并通过发布:

git push origin 1.0.0

Once pushed, the tag could be downloaded by navigating to https://bitbucket.org/<username>/<project>/downloads?tab=tags

推送后,可以通过导航到下载标签 https://bitbucket.org/<username>/<project>/downloads?tab=tags

回答by Brian van Rooijen

If you don't know where to look it will take ages to find the button in the gui.

如果您不知道在哪里查看,则需要很长时间才能在 gui 中找到该按钮。

In the bitbucket gui you can add a tag by browsing to commits. When you open the commit you want to tag there is a "tags" section in the top right of the page. Just below where the branch is displayed. If you click the + button you can tag your commit.

在 bitbucket gui 中,您可以通过浏览提交来添加标签。当您打开要标记的提交时,页面右上角有一个“标记”部分。就在显​​示分支的下方。如果您单击 + 按钮,您可以标记您的提交。

We are running the following version: Atlassian Bitbucket v4.8.3

我们正在运行以下版本:Atlassian Bitbucket v4.8.3

回答by Ogglas

You can also add the tag directly in the Bitbucket UI. Look at Commits, choose a specific commit and then in the details on the right side of the page, click the +-button after No tags.

您也可以直接在 Bitbucket UI 中添加标签。查看Commits,选择一个特定的提交,然后在页面右侧的详细信息中,单击 之后的 -+按钮No tags

enter image description here

在此处输入图片说明

https://confluence.atlassian.com/bitbucket/repository-tags-321860179.html

https://confluence.atlassian.com/bitbucket/repository-tags-321860179.html

回答by cgull

This is what I had to do, but it seems awfully longwinded. Does anyone know a quicker approach?

这是我必须做的,但它似乎非常冗长。有谁知道更快的方法?

rt click on tag under the git repository view. Push Tags, choose remote repo, choose target ref name (ctrl-space) to be refs/heads/master. Select finish.
On the results screen, Select configure select advanced, select add all tags spec, select "finish". This creates a ref mappings in the configure push page with refs/tags/:refs/tags/. Now hit save and push.

rt 单击 git 存储库视图下的标记。推送标签,选择远程仓库,选择目标引用名称(ctrl-space)为 refs/heads/master。选择完成。
在结果屏幕上,选择配置选择高级,选择添加所有标签规范,选择“完成”。这会在配置推送页面中使用 refs/tags/ :refs/tags/创建一个 ref 映射。现在点击保存并推送。