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

Re: Individual file snapshots

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 13, 2010, 00:47 UTC
Message-ID
<7v6362c672.fsf@alter.siamese.dyndns.org>
In-Reply-To
<ca433831002121633j5b96049bs71e539c96397aff4@mail.gmail.com>
Mark Lodato <lodatom@gmail.com> writes:
Show 7 quoted lines
> The basic steps are:
>
> backup .git/index
> git add -a
> git write-tree
> git commit-tree
> restore .git/index
Instead of doing that, you might want to consider
	GIT_INDEX_FILE=...some-temporary-file...
        export GIT_INDEX_FILE

and run everything as if that is the index throughout your script. That way, if your script ever failed in the middle, you won't have to worry about a broken index file.

Previous: Mark LodatoNext: Mark Lodato
Message 13 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.