为什么git默认不推送标签? [英] Why git doesn't push tags by default?

查看:305
本文介绍了为什么git默认不推送标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Git的默认行为是 ,用于将标签从本地存储库推送到关联的远程存储库。在这个答案中,解释了如何为单个存储库更改此行为。



我的问题是为什么是Git的设计行为?特别是设置自动推送标签的优点是什么?

解决方案

如果您考虑任何大型项目的标签(< a href =https://github.com/torvalds/linux/tags =nofollow noreferrer>内核linux , git本身,...)你会在数百个中看到标签。

分布式 VCS全部是关于 发布 :您想要什么推??
一切?所有时间?



推动所有标签可能会污染标签空间上游回购



使用目前的行为,您可以控制您发布到上游回购库的内容,供其他人查看。






请注意,自从git 1.8.3(2013年4月)以来, git push --follow-tags 可以提供帮助您可以在一个命令中推送提交及其相关标签。



请参阅按git提交&标签同时


The default behavior of Git is not to push tags from a local repository to an associated remote one. In this answer it is explained how to change this behavior for a single repository.

My question, is why is this the designed behavior of Git? In particular what are the cons of setting on automatic push of tags?

解决方案

If you consider the tags of any large project (kernel linux, git itself, ...) you would see tags in the hundreds.

A Distributed VCS is all about publication: what do you want to push?
Everything? All the time?

Pushing all tags can pollute the tags space from the upstream repo.

With the current behavior, you keep the control of what you are publishing to the upstream repo, for others to see.


Note that since git 1.8.3 (April 2013), the git push --follow-tags can help you push commits and their associated tags in one command.

See "Push git commits & tags simultaneously".

这篇关于为什么git默认不推送标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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