Re: any way to apply tag across all branches in repository?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tomas Carnecky wrote:

> Tags are not specific to any branch in particular. Usually you tag  
> commits, and git doesn't care on which branch these commits are. That  
> information is not recorded in the tag.
> 
> What you can do is create an alias that iterates over all branches and  
> tags each one.
> 
> git for-each-ref refs/heads/main refs/heads/arch/ | while read sha  
> type ref; do
>      git tag TAGNAME $sha -m "Tagged $ref"
> done
> 
> $sha is the sha where the ref points to, $type will be 'commit' and  
> $ref is the full ref (refs/heads/arch/xxx for example)

I tried something like this manually but on the second branch it complained
that the tag already existed.

Chris
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]