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

Re: Archiving tags/branches?

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 20, 2008, 14:35 UTC
Message-ID
<m3prlvibb7.fsf@localhost.localdomain>
In-Reply-To
<48FC26DA.10508@pcharlan.com>
Pete Harlan <pgit@pcharlan.com> writes:
> Johan Herland wrote:
Show 16 quoted lines
> > BTW, the best way IMHO to archive old refs is to clone your repo
> > (with all tags/branches) to a backup disk, and then regularly push
> > (git push --all && git push --tags) your new tags/branches to this
> > backup. You are now free to delete these tags/branches from your
> > work repo (they will not be deleted from the backup unless you use
> > "git push --mirror"). And if you ever need to retrieve an old
> > tag/branch, it's just a matter of pulling it from the backup
> > repo. Nice, clean, flexible, and requires no changes to git.
> 
> Thank you; that indeed seems to work and solves the problem of managing
> refs/archived-tags manually.
> 
> Using a secondary repo solely to overcome a flat tag/branch namespace
> feels hackish.  Perhaps git will benefit someday from work in this area,
> but until I come up with a patch your suggestion should work fine.  Just
> knowing I didn't overlook an existing feature helps a lot.

I don't quite understand what you mean by _flat_ namespace for tags and branches.

First, it is not unusual to have hierarchical branch names, at least for short-term topic branches. For example in git.git history (and in "What's cooking..." announcements on git mailing list) you can find branch names such as rs/alloc-ref, nd/narrow, tr/workflow-doc. Additionally remote-tracking branch names have inherently hierarchical names: refs/remotes/<remote>/<remote branch>. While tag names usually are of the type x.y.z, it is not mandated by some technological limitation.

Second, you can always put your archived refs in another namespace, beside 'heads', 'tags', and 'remotes'. I for example use refs/tags/Attic for lightweigth tags to some interesting abandoned experiments, but it could have been refs/deleted/tags, or refs/Attic/tags.

Last, please remember that there exists something like packed refs format (see git-pack-refs(1)... oops, it dies not describe .git/packed-refs format, unfortunately).

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Pete HarlanNext: Pete Harlan
Message 11 of 14 in “Archiving tags/branches?”
  1. Pete HarlanOct 18, 2008
  2. David SymondsOct 18, 2008
  3. Pete HarlanOct 20, 2008
  4. SZEDER GáborOct 18, 2008
  5. Johan HerlandOct 18, 2008
  6. SZEDER GáborOct 18, 2008
  7. Johan HerlandOct 18, 2008
  8. Pete HarlanOct 20, 2008
  9. Johan HerlandOct 20, 2008
  10. Pete HarlanOct 21, 2008
  11. Jakub NarebskiOct 20, 2008
  12. Pete HarlanOct 21, 2008
  13. Jakub NarebskiOct 21, 2008
  14. Pete HarlanOct 21, 2008

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.