{"thread":{"id":"8611","subject":"Newbie questions about moving around repositories","startedAt":"2007-06-15T13:52:42Z","lastAt":"2007-06-15T21:58:38Z","messageCount":4,"participants":["Ed Schofield","Alex Riesen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"45133","messageId":"1b5a37350706150652y7710c380l79e785cba8f6b02e@mail.gmail.com","threadId":"8611","inReplyTo":null,"subject":"Newbie questions about moving around repositories","fromName":"Ed Schofield","fromEmail":"edschofield@gmail.com","sentAt":"2007-06-15T13:52:42Z","receivedAt":"2007-06-15T13:52:42Z","isPatch":false,"sender":{"key":"edschofield@gmail.com","avatar":null},"body":"Hi all,\n\nI've recently started using git to manage my own patchsets for a\npublic CVS repository that I don't have write access to. I have a\ncouple of newbie questions, please:\n\n1. I would like to move my repository (including all branches) from\ndirectory A to a directory B on a different filesystem. Can I use\ngit-clone for this? It seems that git-clone creates remote-tracking\nbranches, but I want to keep all of the branches as local branches so\nI can remove the original repository.\n\n2. I can't just move the entire directory A, because I get\n\nError in startup script: error: object directory\nA/../A-cvs-git/.git/objects does not exist; check\n.git/objects/info/alternates\n\nI think I originally created the repository by cloning from my\nA-cvs-git/ directory with git-clone --shared, but I don't quite\nremember. So I suppose I want a way to stop using the alternates\nmechanism and make my repository self-contained in one directory. Is\nthis possible? Will I then be free to move the directory?\n\nI'd appreciate any advice!\n\n-- Ed\n"},{"id":"45134","messageId":"81b0412b0706150718t2382648aw25959844f52c5c02@mail.gmail.com","threadId":"8611","inReplyTo":"1b5a37350706150652y7710c380l79e785cba8f6b02e@mail.gmail.com","subject":"Re: Newbie questions about moving around repositories","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-06-15T14:18:41Z","receivedAt":"2007-06-15T14:18:41Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 6/15/07, Ed Schofield <edschofield@gmail.com> wrote:\n> 1. I would like to move my repository (including all branches) from\n> directory A to a directory B on a different filesystem. Can I use\n> git-clone for this? It seems that git-clone creates remote-tracking\n> branches, but I want to keep all of the branches as local branches so\n> I can remove the original repository.\n\nJust copy it.\n\n> 2. I can't just move the entire directory A, because I get\n>\n> Error in startup script: error: object directory\n> A/../A-cvs-git/.git/objects does not exist; check\n> .git/objects/info/alternates\n\n... but fix that .git/objects/info/alternates files in the repos left to\npoint to the new location of the moved directory.\n\n> I think I originally created the repository by cloning from my\n> A-cvs-git/ directory with git-clone --shared, but I don't quite\n> remember. So I suppose I want a way to stop using the alternates\n> mechanism and make my repository self-contained in one directory. Is\n> this possible?\n\ngit repack -f, and remove the alternates, probably.\nOtherwise you can just copy .git/objects directory into all\nrelated repos, remove alternates there and you're free.\n\n> Will I then be free to move the directory?\n\nYes\n"},{"id":"45144","messageId":"1b5a37350706151019u2bf81e81me05d13ea9bf40591@mail.gmail.com","threadId":"8611","inReplyTo":"81b0412b0706150718t2382648aw25959844f52c5c02@mail.gmail.com","subject":"Re: Newbie questions about moving around repositories","fromName":"Ed Schofield","fromEmail":"edschofield@gmail.com","sentAt":"2007-06-15T17:19:58Z","receivedAt":"2007-06-15T17:19:58Z","isPatch":false,"sender":{"key":"edschofield@gmail.com","avatar":null},"body":"On 6/15/07, Alex Riesen <raa.lkml@gmail.com> wrote:\n> On 6/15/07, Ed Schofield <edschofield@gmail.com> wrote:\n> > 1. I would like to move my repository (including all branches) from\n> > directory A to a directory B on a different filesystem.\n> > [snip]\n>\n> Just copy it.\n> [snip]\n> ... but fix that .git/objects/info/alternates files in the repos left to\n> point to the new location of the moved directory.\n\n\nThanks, Alex! Changing this and .git/branches/origin worked a treat.\n\n-- Ed\n"},{"id":"45151","messageId":"20070615215838.GA6785@steel.home","threadId":"8611","inReplyTo":"1b5a37350706151019u2bf81e81me05d13ea9bf40591@mail.gmail.com","subject":"Re: Newbie questions about moving around repositories","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-06-15T21:58:38Z","receivedAt":"2007-06-15T21:58:38Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Ed Schofield, Fri, Jun 15, 2007 19:19:58 +0200:\n> On 6/15/07, Alex Riesen <raa.lkml@gmail.com> wrote:\n> >On 6/15/07, Ed Schofield <edschofield@gmail.com> wrote:\n> >> 1. I would like to move my repository (including all branches) from\n> >> directory A to a directory B on a different filesystem.\n> >> [snip]\n> >\n> >Just copy it.\n> >[snip]\n> >... but fix that .git/objects/info/alternates files in the repos left to\n> >point to the new location of the moved directory.\n> \n> \n> Thanks, Alex! Changing this and .git/branches/origin worked a treat.\n> \n\n.git/branches is obsoleted. Branch configuration is in .git/config now\n"}]}