From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Barton Subject: Re: MORE: Using git via USB for personal org dir and other data files Date: Sat, 28 Feb 2009 11:58:14 +0000 Message-ID: <49A926D6.9020306@manor-farm.org> References: <7bef1f890902272111l7611d157k984ca50251f20df6@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LdNqC-0006D0-O4 for emacs-orgmode@gnu.org; Sat, 28 Feb 2009 06:58:48 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LdNq9-0006Bz-M7 for emacs-orgmode@gnu.org; Sat, 28 Feb 2009 06:58:47 -0500 Received: from [199.232.76.173] (port=58339 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LdNq8-0006Bg-TH for emacs-orgmode@gnu.org; Sat, 28 Feb 2009 06:58:45 -0500 Received: from a2s22.a2hosting.com ([69.39.86.130]:60173) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LdNq8-0004Kc-9L for emacs-orgmode@gnu.org; Sat, 28 Feb 2009 06:58:44 -0500 Received: from [217.146.125.41] (helo=firewall.banter.local) by a2s22.a2hosting.com with esmtp (Exim 4.69) (envelope-from ) id 1LdNq5-00068K-7W for emacs-orgmode@gnu.org; Sat, 28 Feb 2009 06:58:41 -0500 Received: from localhost (localhost [127.0.0.1]) by firewall.banter.local (Postfix) with ESMTP id DF606C5DB for ; Sat, 28 Feb 2009 11:58:38 +0000 (GMT) Received: from firewall.banter.local ([127.0.0.1]) by localhost (firewall.banter.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BNDDhWUcJZl3 for ; Sat, 28 Feb 2009 11:58:14 +0000 (GMT) Received: from [192.168.0.60] (scamper.banter.local [192.168.0.60]) by firewall.banter.local (Postfix) with ESMTP id C37B5C554 for ; Sat, 28 Feb 2009 11:58:14 +0000 (GMT) In-Reply-To: <7bef1f890902272111l7611d157k984ca50251f20df6@mail.gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode Mailinglist > Here is a rough idea of what I think I need to do now. Please comment > on any ommissions or problems: > > At home, on my primarly workstation: > 1. cd to a directory with a good tree (perhaps ~/org) already under git > control. > 2. insert the USB drive (I have a label "BLUE" on my usb drive. On my > gnome/ubuntu box, it automounts as /media/BLUE) > 3. git clone --bare . /media/BLUE/org.git > 4. git remote add BLUE /media/BLUE/org.git > 5. ?? git push BLUE (master?) > > Now at work, I am on the other workstation: > 1. git clone /media/BLUE/org.git > 2. can I now do this?: git remote add BLUE /media/BLUE/org.git > 2. work > 3. git push BLUE ??? > 4. > > Back at home > 1. git fetch BLUE ?? or git pull BLUE ?? > > > > I am confused at a couple of points here. > > Much of the above I have gleaned from three posts by Bernt Hansen. > Other sources on line include some postings on the very problem of > syncing machines using git. > > Can I pull from /media/BLUE/org.git ? > Alan, Not being a regular git user, I can't help directly with which commands you need to use. However, you might find http://www.netsplit.com/2009/02/23/revision-control-systems-suck/ entertaining. If you have a git repo that contains a "correct" working version, I would suggest that you start from scratch with that. As Bernt suggested you should create a repo with no working trees on your usb stick. This will just contain the repo i.e. .git and nothing else. In bzr you can use push to update your repo on the USB stick, so the .git contains all your changes. Note this only updates the repo, you won't see any of your files in the directory on the usb stick containing the repo (they are all in the .git repo). I think that part of the proble is that push in git doesn't work like you might expect (see the ranting link above). You may need to use got clone the first time you edn your changes, after that I think push should work. Take your usb stick to Machine B and create a working branch from your usb stick. In bzr this would be something like: bzr branch /media/usbstick/my_git_repo/ ~/Documents/org In git I think you need to use clone, with a similar syntax This would create a working copy in ~/Documents/org. Note that bzr would want to create the org directory, so whatever target directory you choose shouldn't exist initially. You can then work on your org files on Computer B and do a git commit when you have finished. In bzr a simple bzr push would update the repo on your usb stick and I think that got works the same way. You can then take your usb stick to Computer A and do a git pull to get your changes. When you have finished working on Computer A doing a git commit and a git push should update the repo on the usb stick. I have almost finished an article on how I use bzr to keep my org files in sync. I am aware that most people using org probably use git, so I have been trying to give my examples using both bzr and git. However, I too find some aspects of git confusing. If we can sort out the correct way to use git, I promise to finish my article and send it to worg! Ian.