emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bernt Hansen <bernt@norang.ca>
To: Paul Mead <paul.d.mead@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Using Git to update more than one machine (one	without	network access)
Date: Wed, 25 Feb 2009 14:31:12 -0500	[thread overview]
Message-ID: <87ab8awby7.fsf@gollum.intra.norang.ca> (raw)
In-Reply-To: loom.20090225T185325-263@post.gmane.org

Paul Mead <paul.d.mead@gmail.com> writes:

> Bernt Hansen <bernt <at> 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                                                  |
                                                       fetch usb, merge
                                                       do more stuff
                                                       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.


  reply	other threads:[~2009-02-25 19:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-25 16:38 Using Git to update more than one machine (one without network access) Paul Mead
2009-02-25 16:58 ` David Thole
2009-02-25 17:12   ` Paul Mead
2009-02-25 17:10 ` Nick Dokos
2009-02-25 17:23   ` Paul Mead
2009-02-25 17:41 ` Ian Barton
2009-02-25 18:09   ` Paul Mead
2009-02-25 18:19   ` Paul Mead
2009-02-25 18:41     ` Bernt Hansen
2009-02-25 18:56       ` Paul Mead
2009-02-25 19:31         ` Bernt Hansen [this message]
2009-02-25 21:12           ` Paul Mead

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ab8awby7.fsf@gollum.intra.norang.ca \
    --to=bernt@norang.ca \
    --cc=emacs-orgmode@gnu.org \
    --cc=paul.d.mead@gmail.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).