* Using Git to update more than one machine (one without network access)
@ 2009-02-25 16:38 Paul Mead
2009-02-25 16:58 ` David Thole
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Paul Mead @ 2009-02-25 16:38 UTC (permalink / raw)
To: emacs-orgmode
I recognize this is more a git question that org-mode, but...
I'm trying to use git to keep my org-mode version up to date on my personal and
work laptops.
The only problem is that my work laptop has a firewall on it which does not
allow git traffic to pass.
I use a repo on a usb drive to keep my emacs init files in sync, but have
absolutely no idea how to do this for my org-mode files. In essence, I'm trying
to first pull changes from //repo.or.cz to my laptop, and then either have a
second repo on the usb drive which I can pull changes onto, or pull from the
laptop to the usb.
Then I have to somehow get the work laptop to pull changes from the usb.
Am I asking for too much here? I want to avoid all the downloading and unzipping
where possible.
Paul
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using Git to update more than one machine (one without network access)
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:41 ` Ian Barton
2 siblings, 1 reply; 12+ messages in thread
From: David Thole @ 2009-02-25 16:58 UTC (permalink / raw)
To: Paul Mead; +Cc: emacs-orgmode
Paul,
The way I've accomplished the task you're talking about is instead of
trying to push and pull *to* the work machine, I use another machine with
less restrictive firewalls to push and pull from. This is how I do it...
Work <-> Web Server <-> Home
The web server acts as my "USB Key", and I have cron jobs to pull and push
updates to and from the servers. So at 7:30, I can have a "git pull" on
my work machine - so it would go to the web server, pull in and merge my
changes before I got to work. Then when I go home, say at 5:10, do a "git
push" back to the web server. At 5:30 or so my home machine can do a "git
pull" and at 7:00 AM do a "git push".
This works pretty well so far. Another solution is to set up your home
machine to have dyndns and enable SSH. You can then just ssh into your
home machine, and use org-mode that way too. I've tried this quite a bit
as well, and am kinda at a crossroads on which I like the most yet...
I hope this helps.
-David
On Wed, 25 Feb 2009, Paul Mead wrote:
> I recognize this is more a git question that org-mode, but...
>
> I'm trying to use git to keep my org-mode version up to date on my personal and
> work laptops.
>
> The only problem is that my work laptop has a firewall on it which does not
> allow git traffic to pass.
>
> I use a repo on a usb drive to keep my emacs init files in sync, but have
> absolutely no idea how to do this for my org-mode files. In essence, I'm trying
> to first pull changes from //repo.or.cz to my laptop, and then either have a
> second repo on the usb drive which I can pull changes onto, or pull from the
> laptop to the usb.
>
> Then I have to somehow get the work laptop to pull changes from the usb.
>
> Am I asking for too much here? I want to avoid all the downloading and unzipping
> where possible.
>
> Paul
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using Git to update more than one machine (one without network access)
2009-02-25 16:58 ` David Thole
@ 2009-02-25 17:12 ` Paul Mead
0 siblings, 0 replies; 12+ messages in thread
From: Paul Mead @ 2009-02-25 17:12 UTC (permalink / raw)
To: emacs-orgmode
David Thole <dthole <at> gmail.com> writes:
>
> Paul,
>
> The way I've accomplished the task you're talking about is instead of
> trying to push and pull *to* the work machine, I use another machine with
> less restrictive firewalls to push and pull from. This is how I do it...
>
> Work <-> Web Server <-> Home
>
> The web server acts as my "USB Key", and I have cron jobs to pull and push
> updates to and from the servers. So at 7:30, I can have a "git pull" on
> my work machine - so it would go to the web server, pull in and merge my
> changes before I got to work. Then when I go home, say at 5:10, do a "git
> push" back to the web server. At 5:30 or so my home machine can do a "git
> pull" and at 7:00 AM do a "git push".
>
> This works pretty well so far. Another solution is to set up your home
> machine to have dyndns and enable SSH. You can then just ssh into your
> home machine, and use org-mode that way too. I've tried this quite a bit
> as well, and am kinda at a crossroads on which I like the most yet...
>
> I hope this helps.
>
Thanks David
your method looks similar to how I'm managing my init files - a single repo on
my usb key (in your case a web server) which I push to and pull from.
My current problem is more complicated (to me!) than that. I'm having difficulty
explaining it though.
On 'home' I pull changes from 'remote' at //repo.or.cz.
What I would like to do then is either:
1. change 'remote' to be my usb key and push changes to that, or
2. use 'home' as 'remote' from my usb key and pull changes.
Then I'd probably use the same strategy when I got to my 'work' laptop - either
the usb key is 'remote', or 'work' becomes 'remote' from POV of the usb.
More like this:
repo.or.cz <-> Home <-> USB <-> Work
If it made it easier, I *could* do:
repo.or.cz <-> USB -> Home
\ -> Work
But that may be even more complicated!
Paul
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using Git to update more than one machine (one without network access)
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:10 ` Nick Dokos
2009-02-25 17:23 ` Paul Mead
2009-02-25 17:41 ` Ian Barton
2 siblings, 1 reply; 12+ messages in thread
From: Nick Dokos @ 2009-02-25 17:10 UTC (permalink / raw)
To: Paul Mead; +Cc: emacs-orgmode
Paul Mead <paul.d.mead@gmail.com> wrote:
> I'm trying to use git to keep my org-mode version up to date on my personal and
> work laptops.
>
> The only problem is that my work laptop has a firewall on it which does not
> allow git traffic to pass.
>
> <snip>
There is another possibility that you might want to investigate: if
there is a SOCKS proxy server available at work, you can arrange to pass
git traffic through that. You'll need a SOCKS client (e.g. dante or
tsocks works fine on Linux - I'm completely ignorant about Windows), and
a tiny amount of configuration to make your client point to the SOCKS
server. Then instead of
git clone git://...
git pull
you say
socksify git clone git://...
socksify git pull
(that's with dante) or
tsocks git clone git://...
tsocks git pull
(with tsocks) and you are done.
Also, it might be possible to use HTTP (presumably, you have an http
proxy at work to get through the firewall) instead of the GIT protocol
to do the pull, but I believe that depends on whether the repository has
been set up properly to allow that - I have not tried it in the org
case, but I was using it for the mainline Linux kernel before I had set
up the SOCKS proxy service: it was slower but it worked.
HTH,
Nick
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using Git to update more than one machine (one without network access)
2009-02-25 17:10 ` Nick Dokos
@ 2009-02-25 17:23 ` Paul Mead
0 siblings, 0 replies; 12+ messages in thread
From: Paul Mead @ 2009-02-25 17:23 UTC (permalink / raw)
To: emacs-orgmode
Nick Dokos <nicholas.dokos <at> hp.com> writes:
> There is another possibility that you might want to investigate: if
> there is a SOCKS proxy server available at work, you can arrange to pass
> git traffic through that.
Nice idea, sadly even the identity of the proxy server is hidden, so I guess
that may not be an option either.
> Also, it might be possible to use HTTP (presumably, you have an http
> proxy at work to get through the firewall) instead of the GIT protocol
> to do the pull, but I believe that depends on whether the repository has
> been set up properly to allow that - I have not tried it in the org
> case, but I was using it for the mainline Linux kernel before I had set
> up the SOCKS proxy service: it was slower but it worked.
That would be a nice solution, but I just tried using git clone
http://repo.or.cz/org-mode and it caused an error, so that doesn't seem to be a
working route, sadly.
Thanks
Paul
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using Git to update more than one machine (one without network access)
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:10 ` Nick Dokos
@ 2009-02-25 17:41 ` Ian Barton
2009-02-25 18:09 ` Paul Mead
2009-02-25 18:19 ` Paul Mead
2 siblings, 2 replies; 12+ messages in thread
From: Ian Barton @ 2009-02-25 17:41 UTC (permalink / raw)
To: emacs-orgmode
> I use a repo on a usb drive to keep my emacs init files in sync, but have
> absolutely no idea how to do this for my org-mode files. In essence, I'm trying
> to first pull changes from //repo.or.cz to my laptop, and then either have a
> second repo on the usb drive which I can pull changes onto, or pull from the
> laptop to the usb.
>
> Then I have to somehow get the work laptop to pull changes from the usb.
>
> Am I asking for too much here? I want to avoid all the downloading and unzipping
> where possible.
>
One way to accomplish this would be to create a "branch" on your usb
stick. Not sure if the terminology is correct here, as I use bzr rather
than git.
You can then create branches on your home computer and your work
computer using the usb stick as a repo. So your workflow would be
Use git clone to create a repo on your usb stick.
Pull changes from Carsten' git repo to your usb stick.
Pull changes from your usb stick to both your work and home computers.
In other words your usb stick is your own master repo.
I am not a VCS guru, so there is probably a simpler way:)
Ian.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using Git to update more than one machine (one without network access)
2009-02-25 17:41 ` Ian Barton
@ 2009-02-25 18:09 ` Paul Mead
2009-02-25 18:19 ` Paul Mead
1 sibling, 0 replies; 12+ messages in thread
From: Paul Mead @ 2009-02-25 18:09 UTC (permalink / raw)
To: emacs-orgmode
Ian Barton <lists <at> manor-farm.org> writes:
> Use git clone to create a repo on your usb stick.
>
> Pull changes from Carsten' git repo to your usb stick.
>
> Pull changes from your usb stick to both your work and home computers.
> In other words your usb stick is your own master repo.
Ian, I hadn't realized you could just clone a clone. Makes sense when I think
about it! Trying that now.
Thanks, Paul
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using Git to update more than one machine (one without network access)
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
1 sibling, 1 reply; 12+ messages in thread
From: Paul Mead @ 2009-02-25 18:19 UTC (permalink / raw)
To: emacs-orgmode
Ian Barton <lists <at> manor-farm.org> writes:
>
> Use git clone to create a repo on your usb stick.
>
> Pull changes from Carsten' git repo to your usb stick.
>
> Pull changes from your usb stick to both your work and home computers.
> In other words your usb stick is your own master repo.
>
It works! Well, in the ansence of any changes to pull it seems to work anyway.
Thanks!
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using Git to update more than one machine (one without network access)
2009-02-25 18:19 ` Paul Mead
@ 2009-02-25 18:41 ` Bernt Hansen
2009-02-25 18:56 ` Paul Mead
0 siblings, 1 reply; 12+ messages in thread
From: Bernt Hansen @ 2009-02-25 18:41 UTC (permalink / raw)
To: Paul Mead; +Cc: emacs-orgmode
Paul Mead <paul.d.mead@gmail.com> writes:
> Ian Barton <lists <at> manor-farm.org> writes:
>
>>
>> Use git clone to create a repo on your usb stick.
>>
>> Pull changes from Carsten' git repo to your usb stick.
>>
>> Pull changes from your usb stick to both your work and home computers.
>> In other words your usb stick is your own master repo.
>>
>
> It works! Well, in the ansence of any changes to pull it seems to work anyway.
Hi Paul,
I suggest you put bare repositories on the USB stick.
On your home machine that has internet access
$ git pull # to update from git.or.cz
Create a bare clone (once) of your repo on the usb stick
$ git clone --bare . /path/to/usb/org-mode.git
Define a remote repo on the USB stick
$ git remote add usb /path/to/usb/org-mode.git
$ git push usb [master and any other branches you want]
After that you can
$ git fetch usb on your workstation to update any new commits 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.
I have all my active repos as bare clones on my 4GB USB stick including
git.git, org-mode.git, my org files, and a bunch of other projects - so
when I'm leaving I grab my laptop, load the USB stick from my
workstation with a script (usb-git-push) and then walk out the door with
my laptop and my USB stick.
I can pull from the USB stick into my laptop after I'm gone.
Synching the other way is similar. On the laptop push to the USB stick,
take the stick to my workstation and git fetch from it. Then I merge
the usb/master and master (and other topic branches) appropriately.
HTH,
Bernt
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using Git to update more than one machine (one without network access)
2009-02-25 18:41 ` Bernt Hansen
@ 2009-02-25 18:56 ` Paul Mead
2009-02-25 19:31 ` Bernt Hansen
0 siblings, 1 reply; 12+ messages in thread
From: Paul Mead @ 2009-02-25 18:56 UTC (permalink / raw)
To: emacs-orgmode
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.
Paul
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using Git to update more than one machine (one without network access)
2009-02-25 18:56 ` Paul Mead
@ 2009-02-25 19:31 ` Bernt Hansen
2009-02-25 21:12 ` Paul Mead
0 siblings, 1 reply; 12+ messages in thread
From: Bernt Hansen @ 2009-02-25 19:31 UTC (permalink / raw)
To: Paul Mead; +Cc: emacs-orgmode
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 |
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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using Git to update more than one machine (one without network access)
2009-02-25 19:31 ` Bernt Hansen
@ 2009-02-25 21:12 ` Paul Mead
0 siblings, 0 replies; 12+ messages in thread
From: Paul Mead @ 2009-02-25 21:12 UTC (permalink / raw)
To: emacs-orgmode
Bernt Hansen <bernt <at> norang.ca> writes:
<snip>
> 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
Bernt, many thanks. I'll need to give some time to study and understand this but
thanks for such a full explanation.
Paul
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2009-02-25 21:12 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2009-02-25 21:12 ` Paul Mead
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).