Thread (30 messages) 30 messages, 7 authors, 2021-10-25

Re: [PATCH 4/4] gitfaq: add entry about syncing working trees

From: Johannes Schindelin <hidden>
Date: 2021-10-20 12:09:25

Hi brian,

On Wed, 20 Oct 2021, brian m. carlson wrote:
Users very commonly want to sync their working tree across machines,
I was confused at first, because I do sync my working trees frequently. I
do this via `git push` and `git pull`, though.

Maybe clarify that you mean rsync, or sync services like DropBox and
OneDrive? I see that you mention "cloud syncing service" below, but I
believe that it might be better to lead with the examples.
often to carry across in-progress work or stashes.  Despite this not
being a recommended approach, users want to do it and are not dissuaded
by suggestions not to, so let's recommend a sensible technique.

The technique that many users are using is their preferred cloud syncing
service, which is a bad idea.  Users have reported problems where they
end up with duplicate files that won't go away (with names like "file.c
2"), broken references, oddly named references that have date stamps
appended to them, missing objects, and general corruption and data loss.
That's because almost all of these tools sync file by file, which is a
great technique if your project is a single word processing document or
spreadsheet, but is utterly abysmal for Git repositories because they
don't necessarily snapshot the entire repository correctly.  They also
tend to sync the files immediately instead of when the repository is
quiescent, so writing multiple files, as occurs during a commit or a gc,
can confuse the tools and lead to corruption.

We know that the old standby, rsync, is up to the task, provided that
the repository is quiescent, so let's suggest that and dissuade people
from using cloud syncing tools.  Let's tell people about common things
they should be aware of before doing this and that this is still
potentially risky.  Additionally, let's tell people that Git's security
model does not permit sharing working trees across users in case they
planned to do that.  While we'd still prefer users didn't try to do
this, hopefully this will lead them in a safer direction.
The remainder of the commit message is very clear.

Thank you,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help