* rsync vs. git-push/pull ? (+kudus)
@ 2008-09-07 6:11 Ramagudi Naziir
2008-09-07 6:27 ` david
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Ramagudi Naziir @ 2008-09-07 6:11 UTC (permalink / raw)
To: git
Hi all,
I have several local git repositories on my machine. I'm the only
user, and use them only locally. Now, sometimes when I need to work
remotely, I just rsync my repositories to my laptop, and keep working
there. When I finish (few hours, days or sometimes weeks later), I
just rsync everything back to my local git repositories on my main
workstation, and continue working there.
Now I was wondering whether it's OK or whether there are bad
implication I might not think of working this way. For example, maybe
some of these little git files are named differently on each machine,
and rsyncing them back and forth makes me piling a lot of clutter (in
that case maybe git-gc will clean up everything). Or maybe something
else horrid is going on and I really should just use git-push or pull.
I really prefer rsync to git-push/pull since it is much more easier -
It's one command that syncs my whole working folder, including the git
repositories..
Thanks a ton !!
Naziir
(btw - I read tons of free/open source development mailing lists and I
think that git has the best community by far. always so helpful and
nice. so thanks for all the help thus far as well)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: rsync vs. git-push/pull ? (+kudus)
2008-09-07 6:11 rsync vs. git-push/pull ? (+kudus) Ramagudi Naziir
@ 2008-09-07 6:27 ` david
2008-09-10 6:31 ` Ramagudi Naziir
2008-09-07 7:38 ` David Brown
2008-09-10 7:05 ` Matthieu Moy
2 siblings, 1 reply; 7+ messages in thread
From: david @ 2008-09-07 6:27 UTC (permalink / raw)
To: Ramagudi Naziir; +Cc: git
On Sun, 7 Sep 2008, Ramagudi Naziir wrote:
> Hi all,
>
> I have several local git repositories on my machine. I'm the only
> user, and use them only locally. Now, sometimes when I need to work
> remotely, I just rsync my repositories to my laptop, and keep working
> there. When I finish (few hours, days or sometimes weeks later), I
> just rsync everything back to my local git repositories on my main
> workstation, and continue working there.
>
> Now I was wondering whether it's OK or whether there are bad
> implication I might not think of working this way. For example, maybe
> some of these little git files are named differently on each machine,
> and rsyncing them back and forth makes me piling a lot of clutter (in
> that case maybe git-gc will clean up everything). Or maybe something
> else horrid is going on and I really should just use git-push or pull.
the git files are names by their content so you don't need to worry about
them being named differently
> I really prefer rsync to git-push/pull since it is much more easier -
> It's one command that syncs my whole working folder, including the git
> repositories..
the problems you can run into with rsync all end up related to one of two
things.
1. what happens if the sync gets interrupted
2. what happens if the source gets updated during the sync
in your case these cannot happen without you knowing it, so you should be
ok.
David Lang
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: rsync vs. git-push/pull ? (+kudus)
2008-09-07 6:11 rsync vs. git-push/pull ? (+kudus) Ramagudi Naziir
2008-09-07 6:27 ` david
@ 2008-09-07 7:38 ` David Brown
2008-09-10 6:35 ` Ramagudi Naziir
2008-09-10 7:05 ` Matthieu Moy
2 siblings, 1 reply; 7+ messages in thread
From: David Brown @ 2008-09-07 7:38 UTC (permalink / raw)
To: Ramagudi Naziir; +Cc: git
On Sun, Sep 07, 2008 at 09:11:47AM +0300, Ramagudi Naziir wrote:
>I really prefer rsync to git-push/pull since it is much more easier -
>It's one command that syncs my whole working folder, including the git
>repositories..
I used to do this quite a bit until after a few times I forgot to sync
before changing things. I solved this by creating a bare repo I could
push/pull from, and pushing one of them to it, then fetching and
merging in the other.
After getting more familiar with git, I now use git with push/pull for
pretty much anything I want synchronized. It nicely keeps track of
what I've done, whereas it is easier with rsync, or even unison, to
forget to do the sync.
David
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: rsync vs. git-push/pull ? (+kudus)
2008-09-07 6:27 ` david
@ 2008-09-10 6:31 ` Ramagudi Naziir
2008-09-10 13:27 ` david
0 siblings, 1 reply; 7+ messages in thread
From: Ramagudi Naziir @ 2008-09-10 6:31 UTC (permalink / raw)
To: david; +Cc: git
Hi David,
On Sun, Sep 7, 2008 at 9:27 AM, <david@lang.hm> wrote:
> On Sun, 7 Sep 2008, Ramagudi Naziir wrote:
>
>> Hi all,
>>
>> I have several local git repositories on my machine. I'm the only
>> user, and use them only locally. Now, sometimes when I need to work
>> remotely, I just rsync my repositories to my laptop, and keep working
>> there. When I finish (few hours, days or sometimes weeks later), I
>> just rsync everything back to my local git repositories on my main
>> workstation, and continue working there.
>>
>> Now I was wondering whether it's OK or whether there are bad
>> implication I might not think of working this way. For example, maybe
>> some of these little git files are named differently on each machine,
>> and rsyncing them back and forth makes me piling a lot of clutter (in
>> that case maybe git-gc will clean up everything). Or maybe something
>> else horrid is going on and I really should just use git-push or pull.
>
> the git files are names by their content so you don't need to worry about
> them being named differently
But can I end up having a lot of clutter ? e.g. if these files change,
then rsync will copy the new files, and the old ones will still be
kept, piling up like crud. is this correct ? is it problematic ? will
git-gc fix it ?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: rsync vs. git-push/pull ? (+kudus)
2008-09-07 7:38 ` David Brown
@ 2008-09-10 6:35 ` Ramagudi Naziir
0 siblings, 0 replies; 7+ messages in thread
From: Ramagudi Naziir @ 2008-09-10 6:35 UTC (permalink / raw)
To: David Brown; +Cc: git
Hi David,
On Sun, Sep 7, 2008 at 10:38 AM, David Brown <git@davidb.org> wrote:
> On Sun, Sep 07, 2008 at 09:11:47AM +0300, Ramagudi Naziir wrote:
>
>> I really prefer rsync to git-push/pull since it is much more easier -
>> It's one command that syncs my whole working folder, including the git
>> repositories..
>
> I used to do this quite a bit until after a few times I forgot to sync
> before changing things. I solved this by creating a bare repo I could
> push/pull from, and pushing one of them to it, then fetching and
> merging in the other.
can you please elaborate on this technique ? I don't really get it.
You mean you have an empty git repository somewhere, with which you
are synchronizing all other repositories ?
>
> After getting more familiar with git, I now use git with push/pull for
> pretty much anything I want synchronized. It nicely keeps track of
> what I've done, whereas it is easier with rsync, or even unison, to
> forget to do the sync.
so you have myriad of git repositories ? and you push/pull all of them
every time you move to another station ? I also have a lot of git
repositories, even for stuff other than source code projects.
thank you
naziir
>
> David
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: rsync vs. git-push/pull ? (+kudus)
2008-09-07 6:11 rsync vs. git-push/pull ? (+kudus) Ramagudi Naziir
2008-09-07 6:27 ` david
2008-09-07 7:38 ` David Brown
@ 2008-09-10 7:05 ` Matthieu Moy
2 siblings, 0 replies; 7+ messages in thread
From: Matthieu Moy @ 2008-09-10 7:05 UTC (permalink / raw)
To: Ramagudi Naziir; +Cc: git
"Ramagudi Naziir" <naziirr@gmail.com> writes:
> Hi all,
>
> I have several local git repositories on my machine. I'm the only
> user, and use them only locally. Now, sometimes when I need to work
> remotely, I just rsync my repositories to my laptop, and keep working
> there. When I finish (few hours, days or sometimes weeks later), I
> just rsync everything back to my local git repositories on my main
> workstation, and continue working there.
>
> Now I was wondering whether it's OK or whether there are bad
Clearly, it's more risky to use rsync: git knows which repository is
ahead of the other, knows it has to do a merge in case the two
diverged, ... but if you really know what you're doing, this should be
OK.
Technically, there's at least one case which can be problematic if you
"rsync" without "--delete": packed references. For example, the tip of
the master branch is normally stored in .git/refs/heads/master, but
after packing, git removes this file, and puts all the references in
.git/packed-refs (so it's just 1 file, eats less inodes, less
round-trips for HTTP fetch, ...). Then, if .git/refs/heads/master is
re-created, it takes precedence over .git/packed-refs. So if you
"git gc" locally, and then "rsync remote/ local/", you'll end up with
an old .git/refs/heads/master that overrides the new .git/packed-refs,
and git will behave as if you went backwards in history.
Easily fixable, but I've been hit by this once and took time to
understand what was happening ;-).
--
Matthieu
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: rsync vs. git-push/pull ? (+kudus)
2008-09-10 6:31 ` Ramagudi Naziir
@ 2008-09-10 13:27 ` david
0 siblings, 0 replies; 7+ messages in thread
From: david @ 2008-09-10 13:27 UTC (permalink / raw)
To: Ramagudi Naziir; +Cc: git
On Wed, 10 Sep 2008, Ramagudi Naziir wrote:
> Hi David,
>
> On Sun, Sep 7, 2008 at 9:27 AM, <david@lang.hm> wrote:
>> On Sun, 7 Sep 2008, Ramagudi Naziir wrote:
>>
>>> Hi all,
>>>
>>> I have several local git repositories on my machine. I'm the only
>>> user, and use them only locally. Now, sometimes when I need to work
>>> remotely, I just rsync my repositories to my laptop, and keep working
>>> there. When I finish (few hours, days or sometimes weeks later), I
>>> just rsync everything back to my local git repositories on my main
>>> workstation, and continue working there.
>>>
>>> Now I was wondering whether it's OK or whether there are bad
>>> implication I might not think of working this way. For example, maybe
>>> some of these little git files are named differently on each machine,
>>> and rsyncing them back and forth makes me piling a lot of clutter (in
>>> that case maybe git-gc will clean up everything). Or maybe something
>>> else horrid is going on and I really should just use git-push or pull.
>>
>> the git files are names by their content so you don't need to worry about
>> them being named differently
>
> But can I end up having a lot of clutter ? e.g. if these files change,
> then rsync will copy the new files, and the old ones will still be
> kept, piling up like crud. is this correct ? is it problematic ? will
> git-gc fix it ?
git keeps copies of all the old files around anyway (that's it's purpose
after all ;-)
when git gc runs it creates pack files to replace the individual files,
but unless you run git gc --prune it does not remove anything and the
individual files hang around.
so when you do the rsync back and forth you should have it delete files
from the target that aren't on the source (or run git gc --prune
afterwords)
David Lang
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-09-10 13:27 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-07 6:11 rsync vs. git-push/pull ? (+kudus) Ramagudi Naziir
2008-09-07 6:27 ` david
2008-09-10 6:31 ` Ramagudi Naziir
2008-09-10 13:27 ` david
2008-09-07 7:38 ` David Brown
2008-09-10 6:35 ` Ramagudi Naziir
2008-09-10 7:05 ` Matthieu Moy
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 NNTP newsgroup(s).