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.
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.
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.
It depends on what you mean by "tag". If you use the word "tag" to mean an actual tag in git, then the answer is "no". However, if you just want a general method to associate a string with multiple commits, you could use git-notes. For example, to associate the string "foo" with multiple commits (that is, to apply the label "foo" to multiple objects), you could do:
git notes --ref labels add -m foo $oid_1
git notes --ref labels add -m foo $oid_2
etc.
You can set GIT_NOTES_REF in the environment to avoid specifying --ref on each invocation of git-notes.
You can view all of the labels with:
git notes --ref labels
and you can view the labels in the history with
GIT_NOTES_REF=refs/notes/labels git log --notes
Depending on your use case, it might be preferred to create a refname that incorporates the label. eg, git notes --ref foo add $oid This allows (requires!) you to add some text to the note (which can be the empty string).