{"thread":{"id":"9019","subject":"git fetch inside a bare repo does nothing","startedAt":"2007-07-13T10:33:03Z","lastAt":"2007-07-13T17:16:48Z","messageCount":5,"participants":["Peter Baumann","CJ van den Berg","Alex Riesen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"47254","messageId":"20070713103303.GD18199@xp.machine.xx","threadId":"9019","inReplyTo":null,"subject":"git fetch inside a bare repo does nothing","fromName":"Peter Baumann","fromEmail":"waste.manager@gmx.de","sentAt":"2007-07-13T10:33:03Z","receivedAt":"2007-07-13T10:33:03Z","isPatch":false,"sender":{"key":"waste.manager@gmx.de","avatar":null},"body":"kblin on IRC wanted to know how to update a bare repo with fetching.\nHe wants to have a bare repo of samba as a mirror and clone from this\nmirror to avoid network traffic and to have several git repos which\ncould all have a different branch checked out. For a better description\nsee [1].\n\nI suggested to use \"git fetch --bare\" inside the bare repo, but this\ndoesn't work. So what I'm asking now if this is intenional behaviour or\na bug, so please could someone  shed some light on it?  Or how is the\nprefered method to update a bare repo *without* pushing to it?\n\n-Peter\n\n[1]: http://wiki.samba.org/index.php/Using_Git_for_Samba_Development\n\nIRC log (unneccessary comments removed):\n\n11:30 < kblin> how do I update a branch I cloned with --bare?\n11:31 < madduck> GIT_DIR=/path/to/dir git pull >\n11:31 < madduck> ?\n11:31 < madduck> without the >\n11:32 < kblin> and for remote repositories, I'd use a URL?\n11:37 < madduck> uh, you can't reallly \"update\" remote repositories in that sense\n11:37 < madduck> what are you trying to do?\n11:37 < madduck> let's have more info!\n11:51 < kblin> madduck: I'm trying to follow http://wiki.samba.org/index.php/Using_Git_for_Samba_Development\n11:52 < kblin> madduck: basically, I want to have a --bare repository that mirrors the remote repository\n               and have a couple of working repositories for the different branches\n11:57 < siprbaum> kblin: I think \"git --bare fetch\" inside your bare repo will solve your problem\n[...]\n12:01 < kblin> siprbaum: git --bare fetch doesn't seem to fetch anything new either\n12:01 < siprbaum> perhaps there isn't anything new to fetch?\n12:02 < siprbaum> but i'm just guessing here and reading the manpage (git) suggested that git --bare fetch _could_ work\n12:02 < kblin> siprbaum: that'd surpise me. I've got a clone without the --bare, and that has a new commit\n[...]\n12:14 < siprbaum> kblin: and you are right. i just tried to fetch inside a bare repo and it doesn't work\n"},{"id":"47257","messageId":"20070713113209.GA9046@prefect.vdbonline.net","threadId":"9019","inReplyTo":"20070713103303.GD18199@xp.machine.xx","subject":"Re: git fetch inside a bare repo does nothing","fromName":"CJ van den Berg","fromEmail":"cj@vdbonline.com","sentAt":"2007-07-13T11:32:10Z","receivedAt":"2007-07-13T11:32:10Z","isPatch":false,"sender":{"key":"cj@vdbonline.com","avatar":"https://gravatar.com/avatar/cb86d32484d54ed858459f2d284018b85fae4b802d457a85c3ed60448c63f1e5?d=mp&s=160"},"body":"On Fri, Jul 13, 2007 at 12:33:03PM +0200, Peter Baumann wrote:\n> kblin on IRC wanted to know how to update a bare repo with fetching.\n> He wants to have a bare repo of samba as a mirror and clone from this\n> mirror to avoid network traffic and to have several git repos which\n> could all have a different branch checked out. For a better description\n> see [1].\n> \n> I suggested to use \"git fetch --bare\" inside the bare repo, but this\n> doesn't work. So what I'm asking now if this is intenional behaviour or\n> a bug, so please could someone  shed some light on it?  Or how is the\n> prefered method to update a bare repo *without* pushing to it?\n\n\"git fetch\" works fine in a bare repo. The issue you're probably having is\nthat \"git clone --bare\" does not add a [remote \"origin\"] section to the\nconfig file like regular \"git clone\" does, so \"git fetch\" has nothing to\ndo. Just add a remote section (either with \"git remote add\" or manually) and\nregular \"git fetch\" will work fine.\n\nJust for reference, this is the remote section that is equivalent to the\noriginal \"git clone --bare your_uri_here\":\n\n[remote \"origin\"]\n        url = your_uri_here\n        fetch = +refs/heads/*:refs/heads/*\n\n\n-- \nCJ van den Berg\n\nmailto:cj@vdbonline.com\n  xmpp:cj@vdbonline.com\n"},{"id":"47258","messageId":"20070713115426.GA4608@xp.machine.xx","threadId":"9019","inReplyTo":"20070713113209.GA9046@prefect.vdbonline.net","subject":"Re: git fetch inside a bare repo does nothing","fromName":"Peter Baumann","fromEmail":"waste.manager@gmx.de","sentAt":"2007-07-13T11:54:26Z","receivedAt":"2007-07-13T11:54:26Z","isPatch":false,"sender":{"key":"waste.manager@gmx.de","avatar":null},"body":"On Fri, Jul 13, 2007 at 01:32:10PM +0200, CJ van den Berg wrote:\n> On Fri, Jul 13, 2007 at 12:33:03PM +0200, Peter Baumann wrote:\n> > kblin on IRC wanted to know how to update a bare repo with fetching.\n> > He wants to have a bare repo of samba as a mirror and clone from this\n> > mirror to avoid network traffic and to have several git repos which\n> > could all have a different branch checked out. For a better description\n> > see [1].\n> > \n> > I suggested to use \"git fetch --bare\" inside the bare repo, but this\n> > doesn't work. So what I'm asking now if this is intenional behaviour or\n> > a bug, so please could someone  shed some light on it?  Or how is the\n> > prefered method to update a bare repo *without* pushing to it?\n> \n> \"git fetch\" works fine in a bare repo. The issue you're probably having is\n> that \"git clone --bare\" does not add a [remote \"origin\"] section to the\n> config file like regular \"git clone\" does, so \"git fetch\" has nothing to\n> do. Just add a remote section (either with \"git remote add\" or manually) and\n> regular \"git fetch\" will work fine.\n> \n> Just for reference, this is the remote section that is equivalent to the\n> original \"git clone --bare your_uri_here\":\n> \n> [remote \"origin\"]\n>         url = your_uri_here\n>         fetch = +refs/heads/*:refs/heads/*\n> \n> \nThx. This wasn't exactly my problem but it lead me to the real problem:\nI used\n\tgit fetch /path/to/repo master\n\nand had forgotten that I had to specify the local ref, too.\n\n\tgit fetch /path/to/repo master:master\n\nworked as expected. Sorry for the noise.\n\n-Peter\n"},{"id":"47260","messageId":"81b0412b0707130548s709709a2nf621b19d10e238a0@mail.gmail.com","threadId":"9019","inReplyTo":"20070713103303.GD18199@xp.machine.xx","subject":"Re: git fetch inside a bare repo does nothing","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-13T12:48:19Z","receivedAt":"2007-07-13T12:48:19Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 7/13/07, Peter Baumann <waste.manager@gmx.de> wrote:\n> I suggested to use \"git fetch --bare\" inside the bare repo, but this\n\n\"git --bare fetch\".\n\nYou swapped \"fetch\" and \"--bare\".\n"},{"id":"47273","messageId":"20070713171648.GA6883@xp.machine.xx","threadId":"9019","inReplyTo":"81b0412b0707130548s709709a2nf621b19d10e238a0@mail.gmail.com","subject":"Re: git fetch inside a bare repo does nothing","fromName":"Peter Baumann","fromEmail":"waste.manager@gmx.de","sentAt":"2007-07-13T17:16:48Z","receivedAt":"2007-07-13T17:16:48Z","isPatch":false,"sender":{"key":"waste.manager@gmx.de","avatar":null},"body":"On Fri, Jul 13, 2007 at 02:48:19PM +0200, Alex Riesen wrote:\n> On 7/13/07, Peter Baumann <waste.manager@gmx.de> wrote:\n>> I suggested to use \"git fetch --bare\" inside the bare repo, but this\n>\n> \"git --bare fetch\".\n>\n> You swapped \"fetch\" and \"--bare\".\n\nSorry, this was only a typo in the mail.\nBut the problem got fixed, anyway.\n\n-Peter\n"}]}