Hare Ram
Hare Ram

Reputation: 783

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.

Upvotes: 27

Views: 19471

Answers (3)

Terry Brown
Terry Brown

Reputation: 1330

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. 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.

Upvotes: 4

jayesh
jayesh

Reputation: 3635

we can add tag only one commit id git add tag -a v1.0 [commit ID]

Upvotes: 1

David Deutsch
David Deutsch

Reputation: 19035

What you are trying to do is not possible. A tag, like a branch, can only point to at most one commit.

Upvotes: 17

Related Questions