{"thread":{"id":"15400","subject":"rsync vs. git-push/pull ? (+kudus)","startedAt":"2008-09-07T06:11:47Z","lastAt":"2008-09-10T13:27:22Z","messageCount":7,"participants":["Ramagudi Naziir","david@lang.hm","David Brown","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"89948","messageId":"dfb262380809062311i3fffb900m5d73f5396b403dbe@mail.gmail.com","threadId":"15400","inReplyTo":null,"subject":"rsync vs. git-push/pull ? (+kudus)","fromName":"Ramagudi Naziir","fromEmail":"naziirr@gmail.com","sentAt":"2008-09-07T06:11:47Z","receivedAt":"2008-09-07T06:11:47Z","isPatch":false,"sender":{"key":"naziirr@gmail.com","avatar":null},"body":"Hi all,\n\nI have several local git repositories on my machine. I'm the only\nuser, and use them only locally. Now, sometimes when I need to work\nremotely, I just rsync my repositories to my laptop, and keep working\nthere. When I finish (few hours, days or sometimes weeks later), I\njust rsync everything back to my local git repositories on my main\nworkstation, and continue working there.\n\nNow I was wondering whether it's OK or whether there are bad\nimplication I might not think of working this way. For example, maybe\nsome of these little git files are named differently on each machine,\nand rsyncing them back and forth makes me piling a lot of clutter (in\nthat case maybe git-gc will clean up everything). Or maybe something\nelse horrid is going on and I really should just use git-push or pull.\n\nI really prefer rsync to git-push/pull since it is much more easier -\nIt's one command that syncs my whole working folder, including the git\nrepositories..\n\nThanks a ton !!\nNaziir\n\n(btw - I read tons of free/open source development mailing lists and I\nthink that git has the best community by far. always so helpful and\nnice. so thanks for all the help thus far as well)\n"},{"id":"89951","messageId":"alpine.DEB.1.10.0809062326000.8096@asgard.lang.hm","threadId":"15400","inReplyTo":"dfb262380809062311i3fffb900m5d73f5396b403dbe@mail.gmail.com","subject":"Re: rsync vs. git-push/pull ? (+kudus)","fromName":"","fromEmail":"david@lang.hm","sentAt":"2008-09-07T06:27:39Z","receivedAt":"2008-09-07T06:27:39Z","isPatch":false,"sender":{"key":"david@lang.hm","avatar":null},"body":"On Sun, 7 Sep 2008, Ramagudi Naziir wrote:\n\n> Hi all,\n>\n> I have several local git repositories on my machine. I'm the only\n> user, and use them only locally. Now, sometimes when I need to work\n> remotely, I just rsync my repositories to my laptop, and keep working\n> there. When I finish (few hours, days or sometimes weeks later), I\n> just rsync everything back to my local git repositories on my main\n> workstation, and continue working there.\n>\n> Now I was wondering whether it's OK or whether there are bad\n> implication I might not think of working this way. For example, maybe\n> some of these little git files are named differently on each machine,\n> and rsyncing them back and forth makes me piling a lot of clutter (in\n> that case maybe git-gc will clean up everything). Or maybe something\n> else horrid is going on and I really should just use git-push or pull.\n\nthe git files are names by their content so you don't need to worry about \nthem being named differently\n\n> I really prefer rsync to git-push/pull since it is much more easier -\n> It's one command that syncs my whole working folder, including the git\n> repositories..\n\nthe problems you can run into with rsync all end up related to one of two \nthings.\n\n1. what happens if the sync gets interrupted\n\n2. what happens if the source gets updated during the sync\n\nin your case these cannot happen without you knowing it, so you should be \nok.\n\nDavid Lang\n"},{"id":"89954","messageId":"20080907073821.GA28289@linode.davidb.org","threadId":"15400","inReplyTo":"dfb262380809062311i3fffb900m5d73f5396b403dbe@mail.gmail.com","subject":"Re: rsync vs. git-push/pull ? (+kudus)","fromName":"David Brown","fromEmail":"git@davidb.org","sentAt":"2008-09-07T07:38:21Z","receivedAt":"2008-09-07T07:38:21Z","isPatch":false,"sender":{"key":"git@davidb.org","avatar":"https://gravatar.com/avatar/94c86a2938470a74c2eac5e2b69afc0871f79a660295c02219597aba8cb101c1?d=mp&s=160"},"body":"On Sun, Sep 07, 2008 at 09:11:47AM +0300, Ramagudi Naziir wrote:\n\n>I really prefer rsync to git-push/pull since it is much more easier -\n>It's one command that syncs my whole working folder, including the git\n>repositories..\n\nI used to do this quite a bit until after a few times I forgot to sync\nbefore changing things.  I solved this by creating a bare repo I could\npush/pull from, and pushing one of them to it, then fetching and\nmerging in the other.\n\nAfter getting more familiar with git, I now use git with push/pull for\npretty much anything I want synchronized.  It nicely keeps track of\nwhat I've done, whereas it is easier with rsync, or even unison, to\nforget to do the sync.\n\nDavid\n"},{"id":"90317","messageId":"dfb262380809092331i3399731cqdec3b2bb79d2fcdd@mail.gmail.com","threadId":"15400","inReplyTo":"alpine.DEB.1.10.0809062326000.8096@asgard.lang.hm","subject":"Re: rsync vs. git-push/pull ? (+kudus)","fromName":"Ramagudi Naziir","fromEmail":"naziirr@gmail.com","sentAt":"2008-09-10T06:31:29Z","receivedAt":"2008-09-10T06:31:29Z","isPatch":false,"sender":{"key":"naziirr@gmail.com","avatar":null},"body":"Hi David,\n\nOn Sun, Sep 7, 2008 at 9:27 AM,  <david@lang.hm> wrote:\n> On Sun, 7 Sep 2008, Ramagudi Naziir wrote:\n>\n>> Hi all,\n>>\n>> I have several local git repositories on my machine. I'm the only\n>> user, and use them only locally. Now, sometimes when I need to work\n>> remotely, I just rsync my repositories to my laptop, and keep working\n>> there. When I finish (few hours, days or sometimes weeks later), I\n>> just rsync everything back to my local git repositories on my main\n>> workstation, and continue working there.\n>>\n>> Now I was wondering whether it's OK or whether there are bad\n>> implication I might not think of working this way. For example, maybe\n>> some of these little git files are named differently on each machine,\n>> and rsyncing them back and forth makes me piling a lot of clutter (in\n>> that case maybe git-gc will clean up everything). Or maybe something\n>> else horrid is going on and I really should just use git-push or pull.\n>\n> the git files are names by their content so you don't need to worry about\n> them being named differently\n\nBut can I end up having a lot of clutter ? e.g. if these files change,\nthen rsync will copy the new files, and the old ones will still be\nkept, piling up like crud. is this correct ? is it problematic ? will\ngit-gc fix it ?\n"},{"id":"90319","messageId":"dfb262380809092335q3d61488gf680c91ac23e69da@mail.gmail.com","threadId":"15400","inReplyTo":"20080907073821.GA28289@linode.davidb.org","subject":"Re: rsync vs. git-push/pull ? (+kudus)","fromName":"Ramagudi Naziir","fromEmail":"naziirr@gmail.com","sentAt":"2008-09-10T06:35:44Z","receivedAt":"2008-09-10T06:35:44Z","isPatch":false,"sender":{"key":"naziirr@gmail.com","avatar":null},"body":"Hi David,\n\nOn Sun, Sep 7, 2008 at 10:38 AM, David Brown <git@davidb.org> wrote:\n> On Sun, Sep 07, 2008 at 09:11:47AM +0300, Ramagudi Naziir wrote:\n>\n>> I really prefer rsync to git-push/pull since it is much more easier -\n>> It's one command that syncs my whole working folder, including the git\n>> repositories..\n>\n> I used to do this quite a bit until after a few times I forgot to sync\n> before changing things.  I solved this by creating a bare repo I could\n> push/pull from, and pushing one of them to it, then fetching and\n> merging in the other.\n\ncan you please elaborate on this technique ? I don't really get it.\nYou mean you have an empty git repository somewhere, with which you\nare synchronizing all other repositories ?\n>\n> After getting more familiar with git, I now use git with push/pull for\n> pretty much anything I want synchronized.  It nicely keeps track of\n> what I've done, whereas it is easier with rsync, or even unison, to\n> forget to do the sync.\n\nso you have myriad of git repositories ? and you push/pull all of them\nevery time you move to another station ? I also have a lot of git\nrepositories, even for stuff other than source code projects.\n\nthank you\nnaziir\n>\n> David\n>\n"},{"id":"90320","messageId":"vpqej3sa3bb.fsf@bauges.imag.fr","threadId":"15400","inReplyTo":"dfb262380809062311i3fffb900m5d73f5396b403dbe@mail.gmail.com","subject":"Re: rsync vs. git-push/pull ? (+kudus)","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-09-10T07:05:28Z","receivedAt":"2008-09-10T07:05:28Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"\"Ramagudi Naziir\" <naziirr@gmail.com> writes:\n\n> Hi all,\n>\n> I have several local git repositories on my machine. I'm the only\n> user, and use them only locally. Now, sometimes when I need to work\n> remotely, I just rsync my repositories to my laptop, and keep working\n> there. When I finish (few hours, days or sometimes weeks later), I\n> just rsync everything back to my local git repositories on my main\n> workstation, and continue working there.\n>\n> Now I was wondering whether it's OK or whether there are bad\n\nClearly, it's more risky to use rsync: git knows which repository is\nahead of the other, knows it has to do a merge in case the two\ndiverged, ... but if you really know what you're doing, this should be\nOK.\n\nTechnically, there's at least one case which can be problematic if you\n\"rsync\" without \"--delete\": packed references. For example, the tip of\nthe master branch is normally stored in .git/refs/heads/master, but\nafter packing, git removes this file, and puts all the references in\n.git/packed-refs (so it's just 1 file, eats less inodes, less\nround-trips for HTTP fetch, ...). Then, if .git/refs/heads/master is\nre-created, it takes precedence over .git/packed-refs. So if you \n\"git gc\" locally, and then \"rsync remote/ local/\", you'll end up with\nan old .git/refs/heads/master that overrides the new .git/packed-refs,\nand git will behave as if you went backwards in history.\n\nEasily fixable, but I've been hit by this once and took time to\nunderstand what was happening ;-).\n\n-- \nMatthieu\n"},{"id":"90348","messageId":"alpine.DEB.1.10.0809100624130.8096@asgard.lang.hm","threadId":"15400","inReplyTo":"dfb262380809092331i3399731cqdec3b2bb79d2fcdd@mail.gmail.com","subject":"Re: rsync vs. git-push/pull ? (+kudus)","fromName":"","fromEmail":"david@lang.hm","sentAt":"2008-09-10T13:27:22Z","receivedAt":"2008-09-10T13:27:22Z","isPatch":false,"sender":{"key":"david@lang.hm","avatar":null},"body":"On Wed, 10 Sep 2008, Ramagudi Naziir wrote:\n\n> Hi David,\n>\n> On Sun, Sep 7, 2008 at 9:27 AM,  <david@lang.hm> wrote:\n>> On Sun, 7 Sep 2008, Ramagudi Naziir wrote:\n>>\n>>> Hi all,\n>>>\n>>> I have several local git repositories on my machine. I'm the only\n>>> user, and use them only locally. Now, sometimes when I need to work\n>>> remotely, I just rsync my repositories to my laptop, and keep working\n>>> there. When I finish (few hours, days or sometimes weeks later), I\n>>> just rsync everything back to my local git repositories on my main\n>>> workstation, and continue working there.\n>>>\n>>> Now I was wondering whether it's OK or whether there are bad\n>>> implication I might not think of working this way. For example, maybe\n>>> some of these little git files are named differently on each machine,\n>>> and rsyncing them back and forth makes me piling a lot of clutter (in\n>>> that case maybe git-gc will clean up everything). Or maybe something\n>>> else horrid is going on and I really should just use git-push or pull.\n>>\n>> the git files are names by their content so you don't need to worry about\n>> them being named differently\n>\n> But can I end up having a lot of clutter ? e.g. if these files change,\n> then rsync will copy the new files, and the old ones will still be\n> kept, piling up like crud. is this correct ? is it problematic ? will\n> git-gc fix it ?\n\ngit keeps copies of all the old files around anyway (that's it's purpose \nafter all ;-)\n\n\nwhen git gc runs it creates pack files to replace the individual files, \nbut unless you run git gc --prune it does not remove anything and the \nindividual files hang around.\n\nso when you do the rsync back and forth you should have it delete files \nfrom the target that aren't on the source (or run git gc --prune \nafterwords)\n\nDavid Lang\n"}]}