我可以拥有不通过推送发送的私有git标签吗? [英] Can I have private git tags that are not sent via a push?

查看:45
本文介绍了我可以拥有不通过推送发送的私有git标签吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我标记正在处理的提交,然后将更改推送到另一个存储库,则说明我也可以推送标记对象.我可以创建未推送的标签吗?例如轻量级标签永远不会被推送,但是标签对象总是被推送吗?

If I tag commits that I am working on, then push changes to another repo, I understand that I can also be pushing tag objects. Can I create tags that are not pushed? Are e.g. lightweight tags never pushed, but tag objects always are?

推荐答案

.git/refs/tags/中创建标记,并且.git/refs下的任何内容都可以潜在地根据您添加的标志进行推送推送或其他命令.话虽如此,

Tags are created in .git/refs/tags/ and anything under .git/refs can potentially be pushed, based on the flags that you add to push or other commands. With that said,

默认情况下,git push命令不会将标签传输到远程 服务器.您将必须显式将标签推送到共享服务器 创建它们之后.

By default, the git push command doesn’t transfer tags to remote servers. You will have to explicitly push tags to a shared server after you have created them.

http://progit.org/book/ch2-6.html

根据@Vincent Scheib的评论,在另一个问题中询问以下引用的评论:

As per @Vincent Scheib's comment asking about the below quoted comment in another question:

如果您在分支上创建新的提交,然后进行推送(因此有一些要转移的内容),则git应该检测到所有指向远程推送后存在的提交的新标签,并且也进行推送."

"if you create new commits on your branch, and then push (so there is something to transfer), git should detect all new tags that point to commits that are present after push on remote side, and push them too."

这是无效的.虽然适用于获取,但错误地认为适用于推送.

It is not valid. It is applicable when fetching though, but wrongly thought to be applicable for push.

这篇关于我可以拥有不通过推送发送的私有git标签吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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