简体   繁体   English

如何在git中标记多个提交

[英]How to tag multiple commits in git

I want to create a single tag for multiple commits(merged branches). 我想为多个提交创建一个标记(合并的分支)。

Can we group multiple commits to a single tag , please help me on this. 我们可以将多个提交分组到一个标签,请帮助我。

What you are trying to do is not possible. 你想要做的是不可能的。 A tag, like a branch, can only point to at most one commit. 标记(如分支)最多只能指向一个提交。

我们可以只添加一个提交ID git add tag -a v1.0 [commit ID]

A really late answer, but you could make tags like 一个非常晚的答案,但你可以制作标签

v1.2_b7_p0
v1.2_b7_p1
v1.2_b7_p2
v1.2_b7_p3

where the last _pX part makes them unique, but you can group by the other part. 最后一个_pX部分使它们唯一,但您可以按其他部分分组。 Possibly: 可能是:

v1.2_b7_code
v1.2_b7_docs
v1.2_b7_demo
v1.2_b7_changelog

would work, depending on why you need so many. 会有用,取决于你需要这么多的原因。

But it does seem a release should be a single commit. 但它似乎确实应该是一次发布。 Maybe a branch is really what you want. 也许分支真的是你想要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM