git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Tomas Carnecky <tom@dbservice.com>
Date
May 19, 2009, 16:52 UTC
Message-ID
<F3E3C849-76E1-4D5F-8305-276C4C205250@dbservice.com>
In-Reply-To
<4A12DDB9.60608@nortel.com>
On May 19, 2009, at 6:26 PM, Chris Friesen wrote:
Show 15 quoted lines
>
> Hi all,
>
> I'm hoping you can help me out...please CC me on replies, I'm not
> subscribed to the list.
>
> We have a piece of software with a "main" branch and multiple
> architecture-specific "target" branches.  At each "official" compile,
> we'd like to tag the commits that went into that compile with an  
> identifier.
>
> Using tags normally requires that the tag be assigned to each branch
> individually--is there any way to apply some sort of designator to the
> head of each branch in the repository all at once rather than doing it
> separately for each branch?

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)

tom
Previous: Chris FriesenNext: Chris Friesen
Message 2 of 16 in “any way to apply tag across all branches in repository?”
  1. Chris FriesenMay 19, 2009
  2. Tomas CarneckyMay 19, 2009
  3. Chris FriesenMay 19, 2009
  4. Brandon CaseyMay 19, 2009
  5. Chris FriesenMay 19, 2009
  6. Linus TorvaldsMay 19, 2009
  7. Chris FriesenMay 19, 2009
  8. Linus TorvaldsMay 19, 2009
  9. Chris FriesenMay 19, 2009
  10. Linus TorvaldsMay 19, 2009
  11. Chris FriesenMay 19, 2009
  12. Brandon CaseyMay 19, 2009
  13. Chris FriesenMay 19, 2009
  14. Brandon CaseyMay 19, 2009
  15. Chris FriesenMay 19, 2009
  16. Brandon CaseyMay 19, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.