emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ian Barton <lists@manor-farm.org>
To: emacs-orgmode Mailinglist <emacs-orgmode@gnu.org>
Subject: Re: MORE: Using git via USB for personal org dir and other data files
Date: Sat, 28 Feb 2009 11:58:14 +0000	[thread overview]
Message-ID: <49A926D6.9020306@manor-farm.org> (raw)
In-Reply-To: <7bef1f890902272111l7611d157k984ca50251f20df6@mail.gmail.com>

> 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.

  reply	other threads:[~2009-02-28 11:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-28  5:11 MORE: Using git via USB for personal org dir and other data files Alan E. Davis
2009-02-28 11:58 ` Ian Barton [this message]
2009-02-28 13:32 ` Bernt Hansen
2009-02-28 20:00   ` Sebastian Rose
2009-02-28 20:01     ` Bernt Hansen
2009-02-28 22:07       ` Sebastian Rose
2009-03-01  1:10         ` Sebastian Rose
     [not found]           ` <7bef1f890902281810n1ccda333yada4e62082bd92c8@mail.gmail.com>
     [not found]             ` <87zlg655pk.fsf@kassiopeya.MSHEIMNETZ>
     [not found]               ` <7bef1f890902281903xa296051xa844059dd4e392a7@mail.gmail.com>
2009-03-01  3:04                 ` Alan E. Davis
2009-03-01  3:05                   ` Alan E. Davis
2009-03-01  4:57                     ` Bernt Hansen
2009-03-01  4:10                   ` Bernt Hansen
2009-03-01 15:07                     ` Sebastian Rose

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  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=49A926D6.9020306@manor-farm.org \
    --to=lists@manor-farm.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).