分支/主标签修订版使用Git增加 [英] Branch/master tag revision increments using Git

查看:81
本文介绍了分支/主标签修订版使用Git增加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图确定一个好的发布管理系统,并结合使用版本号进行标记的标记实践 - 例如1.0。然后,如果我为1.0版本创建了一个新的分支,并且在1.0版本中发布了新的分支,并且然后我切换到该分支并将其标记为1.0,如上所述的系统工作正常。该分支上的其他错误修复如预期的那样显示,1.0-1,1.0-2



但是,对主服务器的任何工作,除非在第一次之后重新标记主服务器在创建1.0分支后提交,也会显示相同的增量:1.0-1,1.0-2



当然,sha1哈希将是唯一的,但我会结束up和master和branch有相同的修订/增量。

有没有什么办法可以避免master标记分支?有没有更好的方法来做到这一点?现在,我在分支1.0之后的唯一选择是在master上做一个次要提交,然后为1.1-dev或其他东西重新标记它。

然后重复每个然而,如果一个分支再次被标记,例如1.0.1版本,那么它似乎也会标记主人,因为这是首先发生的事情? / p>

解决方案

在Git中,您不需要标记分支。您标记提交。如果你想标记你已经得到的分支:分支的名称。 :)

是, git describe 为您提供了诸如 1.0-2-g1ab3183 但这些不是标签!标记是通过 git tag (谁会猜到)完成的,并且使用 git tag 创建的标记是提交标识符的基础 git describe 创建。


I'm trying to nail down a good system for release management, combined with the tagging practice of tagging with version numbers - for example, 1.0. Any changes after that tag will be incremented, like 1.0-1, 1.0-2, etc.

However, if I create a new branch from master for 1.0 release, and then I switch to that branch and tag it 1.0, the system as mentioned above works fine. Additional bug fixes on that branch show as expected, 1.0-1, 1.0-2

However, any work on the master, unless I re-tag the master after the first commit after making the 1.0 branch, will also show the same increment: 1.0-1, 1.0-2

Granted, the sha1 hashes will be unique, but I'd end up having the same revisions/increments from both master and branch.

Is there any way to avoid master from being tagged at all when I just tag the branches? Is there any better way of doing this? Right now, my only option after making branch 1.0 is make one minor commit on master, and then re-tag it for 1.1-dev or something.

Then repeat for each release.

However, if a branch is then tagged again, say for 1.0.1 release, that too seems like it would also tag master since that's what happened first?

解决方案

In Git you don’t tag branches. You tag commits. If you want to "mark" a branch you already got that: the name of the branch. :)

Yes, git describe gives you commit identifiers like 1.0-2-g1ab3183 but those are not tags! Tagging is done with git tag (who’d have guessed), and the tags that are created using git tag are the base for the commit identifiers git describe creates.

这篇关于分支/主标签修订版使用Git增加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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