[ubuntu-za] Sync folders using git

tim@cybersmart.co.za tim at cybersmart.co.za
Thu Feb 24 16:11:04 UTC 2011


Use Dropbox!

Sent from my HTC Desire HD

----- Reply message -----
From: "Daniël Louw" <daniel at dline.co.za>
To: "Ubuntu ZA Mailing List" <ubuntu-za at lists.ubuntu.com>
Subject: [ubuntu-za] Sync folders using git
Date: Thu, Feb 24, 2011 17:25
Hello All.
Being a CS student at university, I tend to do a lot of work on a computer. This work is not done on one machine however..I do work on my home PC, on the PC's in the labs at varsity saving my work to a thumb drive, and on my netbook when I'm sitting under a tree on campus (programming outside, in the sun... Wait what?!)

The fact that work is done on the same fileset on three different locations creates a need to be able to sync files and folders between each other. I've been using Unison for this very purpose for a while now. But it has an irritating "feature": When I delete a directory off one copy of my fileset, and I sync with another copy, the removed directory is right back where It was, as Unison sees the absence of the deleted directory as a reason to copy it back from the other source. The same is true for files. 

So I thought to myself, why can't I use git? Git is smart enough that when I delete a file or directory, it will be removed from the other git repo. And I get the advantage of built in version control for all my programming projects.
Syncing my netbook and my PC is easy. That's a standard git push from one to another using ssh. But the thumb drive is troublesome. Sometimes I use it in my home PC, and sometimes on my netbook.

My question is, how can I use git to sync two folders on one machine, as in sync my documents folder to the documents folder on my thumb drive?
Thanks!
-- 
Regards

Daniël Louw================================daniel at dline.co.zawww.dline.co.za
+27 84 2499 299+12 12 347 8305================================
"In order to understand recursion one must first understand recusion"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-za/attachments/20110224/e275a49c/attachment.html>


More information about the ubuntu-za mailing list