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

Re: How to create tags outside of refs/tags?

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Feb 23, 2011, 12:42 UTC
Message-ID
<4D6500C5.7020803@drmicha.warpmail.net>
In-Reply-To
<AANLkTiki9W_mJKLON+punKJLDWx5rmQdZ3bS16zadYFj@mail.gmail.com>
Christian Halstrick venit, vidit, dixit 22.02.2011 23:08:
Show 26 quoted lines
> Hi,
> 
>> How about taking advantage of the fact that you do not have to treat tag
>> namespace as a global thing?  For the "release tool" to "get a commit ID"
>> and do something useful, the "release tool" must be working on a git
>> repository, and hopefully that repository is something other than the ones
>> developers directly play with (by checking out random branches in its
>> working tree and compiling, etc.).
> 
> These assumptions are all correct. The "release tool" works on his clone
> of a central repo. The release tool may even modify the content (e.g. increasing
> release numbers in project metadata files) and create new git commits.
> In the end it wants to create tags/refs locally und push these tags back
> so that in the central repo the commits are not gc'ed.
> 
> Something like:
> 
> cd <releaseRepo>
> git fetch origin
> git checkout <commitIdToRelease>
> edit pom.xml; git add pom.xml
> git commit -m "release ..."
> git tag <releaseName>
> git push origin 'refs/tags/<releaseName>:refs/releases/<releaseName>'
> 
> should do the job, or?
Yep. Also, if you do
git tag release/<releasename>

then a simple push refspec 'refs/tags/release/*:refs/releases/*' in your config does the job. (Assuming you don't have any other tags in release/.)

Michael
Previous: Christian HalstrickNext: Christian Halstrick
Message 13 of 16 in “How to create tags outside of refs/tags?”
  1. Christian HalstrickFeb 21, 2011
  2. Jay SoffianFeb 21, 2011
  3. Junio C HamanoFeb 21, 2011
  4. Christian HalstrickFeb 22, 2011
  5. Jeff KingFeb 22, 2011
  6. Junio C HamanoFeb 22, 2011
  7. Jeff KingFeb 22, 2011
  8. Jakub NarebskiFeb 22, 2011
  9. Jeff KingFeb 22, 2011
  10. Christian HalstrickFeb 22, 2011
  11. Junio C HamanoFeb 22, 2011
  12. Christian HalstrickFeb 22, 2011
  13. Michael J GruberFeb 23, 2011
  14. Christian HalstrickFeb 23, 2011
  15. Enrico WeigeltFeb 23, 2011
  16. Jay SoffianFeb 22, 2011

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.