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

Re: [PATCH 4/4] doc: add a FAQ entry about syncing working trees

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Oct 21, 2021, 00:03 UTC
Message-ID
<YXCuQ3KID6iq0vwa@camp.crustytoothpaste.net>
In-Reply-To
<211021.86r1cfmfhh.gmgdl@evledraar.gmail.com>
On 2021-10-20 at 23:35:43, Ævar Arnfjörð Bjarmason wrote:
Show 15 quoted lines
> 
> On Wed, Oct 20 2021, brian m. carlson wrote:
> 
> > +The recommended approach is to use `rsync -a --delete-after` (ideally with an
> > +encrypted connection such as with `ssh`) on the root of repository.  You should
> > +ensure several things when you do this:
> 
> What's the reason to recommend --delete-after in particular? I realize
> that e.g. in the .git directory not using *A* delete option *will* cause
> corruption, e.g. if you can leave behind stale loose refs with an
> up-to-date pack-refs file.
> 
> But isn't that equally covered by --delete and --delete-before? I'm not
> very well worsed in rsync, but aren't the two equivalent as far as the
> end-state goes?

Yes. The goal is that if something goes wrong, you have all the objects you did before, even if you have some potentially invalid refs. The goal is to make it a little less risky if you interrupt it with a Ctrl-C because you realize the destination contained data you wanted. I always prefer --delete-after for that reason, assuming the destination has sufficient disk space.

It shouldn't make a difference in a successful end state, however.
Show 9 quoted lines
> 
> > +Be aware that even with these recommendations, syncing in this way is
> > +potentially risky since it bypasses Git's normal integrity checking for
> > +repositories, so having backups is advised.
> 
> Perhaps we should recommend running a "git gc" or other integrity check
> after (or "git fsck"), although those don't cover some cases, e.g. the
> pack-refs v.s. loose refs problem in the case of a missing
> --delete-whatever.
I can recommend something like that.
-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 12 of 30 in “Additional FAQ entries”
  1. 0/4 Additional FAQ entriesbrian m. carlson, Oct 20, 2021
  2. 3/4 gitfaq: give advice on using eol attribute in gitattributesbrian m. carlson, Oct 20, 2021
  3. Eric SunshineOct 20, 2021
  4. brian m. carlsonOct 20, 2021
  5. Johannes SchindelinOct 20, 2021
  6. brian m. carlsonOct 20, 2021
  7. Johannes SchindelinOct 21, 2021
  8. 4/4 doc: add a FAQ entry about syncing working treesbrian m. carlson, Oct 20, 2021
  9. Bagas SanjayaOct 20, 2021
  10. Philip OakleyOct 20, 2021
  11. Ævar Arnfjörð BjarmasonOct 20, 2021
  12. brian m. carlsonOct 21, 2021
  13. Ævar Arnfjörð BjarmasonOct 21, 2021
  14. 4/4 gitfaq: add entry about syncing working treesbrian m. carlson, Oct 20, 2021
  15. Eric SunshineOct 20, 2021
  16. brian m. carlsonOct 20, 2021
  17. Johannes SchindelinOct 20, 2021
  18. 1/4 gitfaq: add advice on monoreposbrian m. carlson, Oct 20, 2021
  19. Bagas SanjayaOct 20, 2021
  20. Ævar Arnfjörð BjarmasonOct 20, 2021
  21. brian m. carlsonOct 20, 2021
  22. Johannes SchindelinOct 20, 2021
  23. Philip OakleyOct 20, 2021
  24. brian m. carlsonOct 20, 2021
  25. Philip OakleyOct 25, 2021
  26. 2/4 gitfaq: add documentation on proxiesbrian m. carlson, Oct 20, 2021
  27. Johannes SchindelinOct 20, 2021
  28. brian m. carlsonOct 20, 2021
  29. Junio C HamanoOct 20, 2021
  30. brian m. carlsonOct 20, 2021

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.