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

Re: Advice on choosing git

From
JBJoe Brenner <doom@kzsu.stanford.edu>
Date
May 13, 2010, 00:18 UTC
Message-ID
<201005130018.o4D0I7iI079145@kzsu.stanford.edu>
In-Reply-To
<4BEA4B46.6010009@smartmediacorp.com>
Noah Silverman <noah@smartmediacorp.com> wrote:
> I'm looking for both a version control system and backup system.

I had a similar thought some time ago. I thought that putting my life inside of a distributed version control system (my first thought back then was Monotone) would also be a convienient way to handle the laptop-workstation sync problem.

But:
> 1) Size.  THIS IS MY MAIN CONCERN - If I want to sync my home, office,
> and server Document directories.  From what I have read, I will
> effectively have multiple copies of each item on my hard drive, thus
> eating up a lot of space

Pretty much any version control system is going to have this problem, and it gets really bad if you've got any files that aren't straight text.

You won't get any benefit out of things like "git diff" either. The diffs we have (these days at least) don't work well on anything but plain text.

I suggest you stick to using git down on the project level, where a project should be limited to things like code development (or writing projects where you stick to text formats), and give up on any ideas like putting your entire home directory into a single repository.

As far as mirroring machines go, rsync based solutions actually aren't that bad, though in addition to the annoying syntax gotchas, I've had problems with an unreliable laptop clock. Lately I've been using the "--size-only" option of rsync, which assumes that if a file is bigger it must be newer.

I tend to use a perl script something like this, which copies newer stuff from a given directory to an analogous directory on a remote machine:

  use File::Basename qw( dirname );
  my $this  = shift;   # e.g. '/home/doom/dev/code
  my $there = shift;   # e.g. 'doom@192.168.1.3'
  my $this_loc = dirname( $this );
  $cmd = "rsync -avz --size-only -e ssh $this $there:$this_loc";
  system( $cmd );
Previous: Jonathan NiederNext: Avery Pennarun
Message 5 of 13 in “Advice on choosing git”
  1. Noah SilvermanMay 12, 2010
  2. Dmitry PotapovMay 12, 2010
  3. Ramkumar RamachandraMay 12, 2010
  4. Jonathan NiederMay 12, 2010
  5. Joe BrennerMay 13, 2010
  6. Avery PennarunMay 13, 2010
  7. Matthieu MoyMay 13, 2010
  8. Avery PennarunMay 13, 2010
  9. Anthony W. YoungmanMay 19, 2010
  10. Avery PennarunMay 19, 2010
  11. Matthieu MoyMay 13, 2010
  12. Jeff KingMay 13, 2010
  13. Martin LanghoffMay 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.