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

Re: Individual file snapshots

From
RGRon Garret <ron1@flownet.com>
Date
Feb 12, 2010, 17:24 UTC
Message-ID
<ron1-278C58.09242712022010@news.gmane.org>
In-Reply-To
<alpine.DEB.2.00.1002121316260.10583@ds9.cixit.se>
In article <alpine.DEB.2.00.1002121316260.10583@ds9.cixit.se>,
 Peter Krefting <peter@softwolves.pp.se> wrote:
Show 16 quoted lines
> Ron Garret:
> 
> > I would like to be able to store snapshots of individual files without 
> > making a commit on the main branch.
> 
>    git hash-object -w filename
> 
> will add the file to the object database, outputting it's hash value.
> 
>    git tag mytag hashvalue
> 
> creates a tag "mytag" pointing to that file.
> 
>    git show mytag
> 
> will output the file you put in.

Ah, cool! Thanks. I knew about git hash-object, but I did not know that you could tag the resulting hash. I thought you could only tag commit objects.

rg
Previous: Peter KreftingNext: René Scharfe
Message 3 of 18 in “Individual file snapshots”
  1. Ron GarretFeb 12, 2010
  2. Peter KreftingFeb 12, 2010
  3. Ron GarretFeb 12, 2010
  4. René ScharfeFeb 12, 2010
  5. Ron GarretFeb 12, 2010
  6. Brian GernhardtFeb 12, 2010
  7. Ron GarretFeb 12, 2010
  8. Junio C HamanoFeb 12, 2010
  9. Ron GarretFeb 12, 2010
  10. Brian GernhardtFeb 12, 2010
  11. Ron GarretFeb 12, 2010
  12. Mark LodatoFeb 13, 2010
  13. Junio C HamanoFeb 13, 2010
  14. Mark LodatoFeb 13, 2010
  15. Ron GarretFeb 13, 2010
  16. Junio C HamanoFeb 13, 2010
  17. Ron GarretFeb 13, 2010
  18. Larry D'AnnaFeb 13, 2010

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.