{"thread":{"id":"25176","subject":"GIT and Cloning Remote Repositories into \"Local Remote\" Repositories","startedAt":"2010-09-21T01:22:09Z","lastAt":"2010-09-27T15:29:03Z","messageCount":6,"participants":["Grant Erickson","Casey Dahlin","Tay Ray Chuan"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"151176","messageId":"C8BD56D1.1E331%gerickson@nuovations.com","threadId":"25176","inReplyTo":null,"subject":"GIT and Cloning Remote Repositories into \"Local Remote\" Repositories","fromName":"Grant Erickson","fromEmail":"gerickson@nuovations.com","sentAt":"2010-09-21T01:22:09Z","receivedAt":"2010-09-21T01:22:09Z","isPatch":false,"sender":{"key":"gerickson@nuovations.com","avatar":null},"body":"I'm still in the stage of using GIT where I \"know enough to be dangerous\".\nThat said, I am trying to set something up and get it \"right\" to avoid pain\nlater. However, after reading GIT online help and various FAQs, it is still\nunclear what the right thing or steps to perform are.\n\nHere's the scenario:\n\n1) I have a private repository set-up at GitHub that I can commit, push and\npull to my heart's content. This is all working well.\n\n2) I now need to import some third-party software, two packages in\nparticular (U-Boot and Linux), at specific tags into subdirectories within\nmy repository in (1).\n\n3) Changes in these subdirectories in (2) should ONLY go to GitHub but NEVER\nto the origin of the clone UNLESS the user (usually me) really knows what\nhe/she is doing.\n\nI know how to use 'git clone' to clone a remote repository and make local\ncommits there; however, what I think I want is a 'clone into':\n\n    % cd <path to the local copy of my GitHub repo>\n    % git clone <URL to package A @ tag S> <package A subdirectory>\n    % git commit -m \"Imported package A @ tag S\" <package A subdirectory>\n    % git clone <URL to package B @ tag T> <package B subdirectory>\n    % git commit -m \"Imported package B @ tag T\" <package B subdirectory>\n    % git push\n\nSome time later, when Package A or Package B is updated to a new release\ntag, I'd like to be able to choose (but not automatically) to merge those\nchanges in with my own changes and then update my GitHub repository.\n\nPerhaps 'submodules' are what I am looking for?\n\nAnyone have a good recipe or good hygiene/best practice recommendations for\nthis?\n\nBest,\n\nGrant Erickson\n"},{"id":"151177","messageId":"20100921013700.GC8380@foucault.redhat.com","threadId":"25176","inReplyTo":"C8BD56D1.1E331%gerickson@nuovations.com","subject":"Re: GIT and Cloning Remote Repositories into \"Local Remote\" Repositories","fromName":"Casey Dahlin","fromEmail":"cdahlin@redhat.com","sentAt":"2010-09-21T01:37:00Z","receivedAt":"2010-09-21T01:37:00Z","isPatch":false,"sender":{"key":"cdahlin@redhat.com","avatar":null},"body":"On Mon, Sep 20, 2010 at 06:22:09PM -0700, Grant Erickson wrote:\n> Perhaps 'submodules' are what I am looking for?\n> \n\nYup, exactly :) the manpage git submodule should get you going.\n\n--CJD\n"},{"id":"151182","messageId":"AANLkTimR_qo-LP=_VmUTb=LFGfoW1tLq2Qyn5FTh9ogf@mail.gmail.com","threadId":"25176","inReplyTo":"C8BD56D1.1E331%gerickson@nuovations.com","subject":"Re: GIT and Cloning Remote Repositories into \"Local Remote\" Repositories","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-09-21T04:26:41Z","receivedAt":"2010-09-21T04:26:41Z","isPatch":false,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Tue, Sep 21, 2010 at 9:22 AM, Grant Erickson\n<gerickson@nuovations.com> wrote:\n> 3) Changes in these subdirectories in (2) should ONLY go to GitHub but NEVER\n> to the origin of the clone UNLESS the user (usually me) really knows what\n> he/she is doing.\n\nThen be careful with the default remotes - for example, \"origin\", or\nbranch-specific default remotes.\n\n-- \nCheers,\nRay Chuan\n"},{"id":"151775","messageId":"C8C53EC9.1E621%gerickson@nuovations.com","threadId":"25176","inReplyTo":"20100921013700.GC8380@foucault.redhat.com","subject":"Re: GIT and Cloning Remote Repositories into \"Local Remote\" Repositories","fromName":"Grant Erickson","fromEmail":"gerickson@nuovations.com","sentAt":"2010-09-27T01:17:45Z","receivedAt":"2010-09-27T01:17:45Z","isPatch":false,"sender":{"key":"gerickson@nuovations.com","avatar":null},"body":"On 9/20/10 6:37 PM, Casey Dahlin wrote:\n> On Mon, Sep 20, 2010 at 06:22:09PM -0700, Grant Erickson wrote:\n>> Perhaps 'submodules' are what I am looking for?\n>> \n> \n> Yup, exactly :) the manpage git submodule should get you going.\n\nCasey:\n\nThanks for the prompt reply.\n\nI spent some time over the weekend playing with the various submodule\ntutorials and I wasn't left feeling convinced that it's the right solution,\nparticularly with the added complexity around commits and pushes (trailing\nslashes, etc.) that I am sure my users are going to get wrong more often\nthan right.\n\nIn further explorations, it occurred to me that the \"subtree\" merge strategy\nmight be another, perhaps, better alternative. However, when I tried it\nbased on the example at\nhttp://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.ht\nml, I got some results that were unexpected, such as files showing up where\nI didn't want them to: top-of-tree rather than the intended subdirectory.\n\nBasically, I am starting out a project with x-loader, u-boot and linux based\non the Arago project GIT at tag OMAPPSP_03.00.01.06, from which TI's\nsomewhat-dated PSP is based:\n\n    git://arago-project.org/git/projects/x-load-omap3.git\n    git://arago-project.org/git/projects/u-boot-omap3.git\n    git://arago-project.org/git/projects/linux-omap3.git\n\nAt some point, once my system is stable, I'd like to merge both u-boot and\nlinux up to mainline revisions/tags with my local changes included from:\n\n    git://git.denx.de/u-boot.git\n    git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git\n\nMy tree is organized roughly as:\n\n    root/\n        .git/\n        fw/\n            u-boot/\n                Makefile\n                u-boot/\n                    <Actual contents of GIT tree here>\n            x-loader/\n                Makefile\n                x-loader/\n                    <Actual contents of GIT tree here>\n        sw/\n            tps/\n                linux/\n                    Makefile\n                    linux/\n                        <Actual contents of GIT tree here>\n\nMy ideal workflow would be:\n\n    1) Merge Arago GIT git://arago-project.org/git/projects/u-boot-omap3.git\nto root/fw/u-boot/u-boot/.\n    2) Make local changes.\n    3) % git commit ...\n       % git push <to GitHub repo master>\n    4) Make more local changes.\n    5) % git commit ...\n       % git push <to GitHub repo master>\n    6) Ad infinitum until local changes are stable\n    7) Merge Denx GIT git://git.denx.de/u-boot.git @ v2010.09-rc2 to\nroot/fw/u-boot/u-boot/.\n       % git <something> ...\n    8) Resolve conflicts, commit and push to GitHub repo master.\n\nAnd so on for the linux subtree as well. Any further tips or course\ncorrections you can offer, particularly relative to subtree merges?\n\nBest,\n\nGrant\n"},{"id":"151828","messageId":"20100927151807.GE31809@foucault.redhat.com","threadId":"25176","inReplyTo":"C8C53EC9.1E621%gerickson@nuovations.com","subject":"Re: GIT and Cloning Remote Repositories into \"Local Remote\" Repositories","fromName":"Casey Dahlin","fromEmail":"cdahlin@redhat.com","sentAt":"2010-09-27T15:18:08Z","receivedAt":"2010-09-27T15:18:08Z","isPatch":false,"sender":{"key":"cdahlin@redhat.com","avatar":null},"body":"On Sun, Sep 26, 2010 at 06:17:45PM -0700, Grant Erickson wrote:\n> On 9/20/10 6:37 PM, Casey Dahlin wrote:\n> > On Mon, Sep 20, 2010 at 06:22:09PM -0700, Grant Erickson wrote:\n> >> Perhaps 'submodules' are what I am looking for?\n> >> \n> > \n> > Yup, exactly :) the manpage git submodule should get you going.\n> \n> Casey:\n> \n> Thanks for the prompt reply.\n> \n> I spent some time over the weekend playing with the various submodule\n> tutorials and I wasn't left feeling convinced that it's the right solution,\n> particularly with the added complexity around commits and pushes (trailing\n> slashes, etc.) that I am sure my users are going to get wrong more often\n> than right.\n> \n*snip*\n> \n> And so on for the linux subtree as well. Any further tips or course\n> corrections you can offer, particularly relative to subtree merges?\n> \n\nUnfortunately I'm not an expert here. I know what submodules do but I haven't\nused them much (in fact I last looked at them just after they were introduced.\nThey were even rougher back then).\n\nI may have missed it but if you haven't I'd update the list on all of this\nagain.\n\n--CJD\n"},{"id":"151830","messageId":"C8C6064F.1E675%gerickson@nuovations.com","threadId":"25176","inReplyTo":"20100927151807.GE31809@foucault.redhat.com","subject":"Re: GIT and Cloning Remote Repositories into \"Local Remote\" Repositories","fromName":"Grant Erickson","fromEmail":"gerickson@nuovations.com","sentAt":"2010-09-27T15:29:03Z","receivedAt":"2010-09-27T15:29:03Z","isPatch":false,"sender":{"key":"gerickson@nuovations.com","avatar":null},"body":"On 9/27/10 8:18 AM, Casey Dahlin wrote:\n> On Sun, Sep 26, 2010 at 06:17:45PM -0700, Grant Erickson wrote:\n>> On 9/20/10 6:37 PM, Casey Dahlin wrote:\n>>> On Mon, Sep 20, 2010 at 06:22:09PM -0700, Grant Erickson wrote:\n>>>> Perhaps 'submodules' are what I am looking for?\n>>> \n>>> Yup, exactly :) the manpage git submodule should get you going.\n>> \n>> Casey:\n>> \n>> Thanks for the prompt reply.\n>> \n>> I spent some time over the weekend playing with the various submodule\n>> tutorials and I wasn't left feeling convinced that it's the right solution,\n>> particularly with the added complexity around commits and pushes (trailing\n>> slashes, etc.) that I am sure my users are going to get wrong more often\n>> than right.\n>> \n> *snip*\n>> \n>> And so on for the linux subtree as well. Any further tips or course\n>> corrections you can offer, particularly relative to subtree merges?\n>> \n> \n> Unfortunately I'm not an expert here. I know what submodules do but I haven't\n> used them much (in fact I last looked at them just after they were introduced.\n> They were even rougher back then).\n> \n> I may have missed it but if you haven't I'd update the list on all of this\n> again.\n\nCasey:\n\nOver the course of the weekend, I found a tool, braids, that does EXACTLY\nwhat I need. While it'd be great if it were integrated into GIT, I'll take\nit's external nature for now:\n\n    http://github.com/evilchelu/braid\n\nIt would appear that in the background it uses the subtree merge strategy\nand a repository-local metadata files (.braids) to accomplish what it does.\n\nBest,\n\nGrant\n"}]}