From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: Using Git to update more than one machine (one without network access) Date: Wed, 25 Feb 2009 14:31:12 -0500 Message-ID: <87ab8awby7.fsf@gollum.intra.norang.ca> References: <49A582C2.3090407@manor-farm.org> <87eixmwe96.fsf@gollum.intra.norang.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LcPTQ-0003Wu-Ji for emacs-orgmode@gnu.org; Wed, 25 Feb 2009 14:31:16 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LcPTQ-0003WL-2a for emacs-orgmode@gnu.org; Wed, 25 Feb 2009 14:31:16 -0500 Received: from [199.232.76.173] (port=53476 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LcPTP-0003WF-PG for emacs-orgmode@gnu.org; Wed, 25 Feb 2009 14:31:15 -0500 Received: from mho-02-bos.mailhop.org ([63.208.196.179]:65052) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LcPTP-0003k0-DN for emacs-orgmode@gnu.org; Wed, 25 Feb 2009 14:31:15 -0500 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: Paul Mead Cc: emacs-orgmode@gnu.org Paul Mead writes: > Bernt Hansen norang.ca> writes: > >> I suggest you put bare repositories on the USB stick. > ... > > > >> $ git push # update any existing branches on the usb stick >> >> On your work machine just clone the USB repo >> >> $ git clone /path/to/usb/org-mode.git >> >> and you should be all set. > > Bernt, your version seems more complicated to me, but I'm keen to understand > more so I'll try to work through the manual to get a better understanding of > your method, thanks. At the moment I'm not at all clear what the benefits of > using a bare repo rather than just cloning the original for instance. The bare repo has no working directory - it's just the repository (the .git dir basically) and you use it for moving commits and history between your two working copies of the repository. In effect the usb version is no different than the version you pull from at git.org.cz - it's just another copy of the repository. Your home machine USB bare repo Your work machine ----------------- ------------- ----------------- org org.git org [H] -----push------------> [U] --------fetch-----------> [W] [O] [S] [O] [M] <----fetch------------ [B] <-------push------------- [R] [E] [K] you work here and you work here do stuff, commit --->----------------------------------------\ push to usb | v fetch usb, merge do more stuff commit push to usb | fetch new stuff from usb <-----------------------------------/ If you push to a NON-BARE repository you'll update the repository but not the working directory - it's not very nice to work with. You need to git reset --hard between push operations and if you have changes in both places at the same time it's a mess. It also takes more space for the working directories which you probably never use on a USB stick. With a bare repository you don't work on the USB stick - it's just a medium for moving your data (commits) from your home machine to your work machine and vice versa. It also happens to be a great backup for your work... if you have a fire and your work machine melts... you have a copy on your USB stick, and on your home machine etc. I used to sync files directly over the network between my workstation and my laptop essentially pushing to a non-bare repository on the laptop (and vice versa). The setup with a non-bare repository in between works _much_ better and is way less confusing. For synching org-mode.git it's easy. You home machine will have two remote repositories defined (origin = git.or.cz) and usb (your stick). On your master branch you $ git pull [origin] to get new commits from origin and then $ git push usb to update the stick with those commits. At work you clone the stick (once) and origin at work is the usb stick. Then you git fetch or git pull at work to get commits from the usb stick as needed. HTH, -Bernt