{"thread":{"id":"12985","subject":"Submodules and branches","startedAt":"2008-04-04T19:40:18Z","lastAt":"2008-04-04T20:07:16Z","messageCount":3,"participants":["Pat Maddox","Avery Pennarun"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"73661","messageId":"810a540e0804041240p4efd0973g7f46a2021b352822@mail.gmail.com","threadId":"12985","inReplyTo":null,"subject":"Submodules and branches","fromName":"Pat Maddox","fromEmail":"pergesu@gmail.com","sentAt":"2008-04-04T19:40:18Z","receivedAt":"2008-04-04T19:40:18Z","isPatch":false,"sender":{"key":"pergesu@gmail.com","avatar":null},"body":"I've got a repository that uses submodules.  If I cd to the repo root\nand create a branch, all the submodules are switched to that branch as\nwell.  All good so far.  I go into the submodules and do my work,\ncommitting as I go along.  Then when I'm all done and want to merge\nthe changes into my master branch, I cd back to the repo root and do\n\"git merge new_topic\"\n\nThat's where it breaks down.  The commits that I made go into the\nmaster repo itself, and the submodules don't have them.  So when I\npush from the submodule to its origin, nothing goes through.  The code\nis now a part of the master repo.\n\nIs it possible for me to use branches like usual, but with submodules?\n\nPat\n"},{"id":"73662","messageId":"32541b130804041302i1e32e4b3l141e8b08200a2357@mail.gmail.com","threadId":"12985","inReplyTo":"810a540e0804041240p4efd0973g7f46a2021b352822@mail.gmail.com","subject":"Re: Submodules and branches","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-04-04T20:02:55Z","receivedAt":"2008-04-04T20:02:55Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On 4/4/08, Pat Maddox <pergesu@gmail.com> wrote:\n> I've got a repository that uses submodules.  If I cd to the repo root\n>  and create a branch, all the submodules are switched to that branch as\n>  well.  All good so far.  I go into the submodules and do my work,\n>  committing as I go along.  Then when I'm all done and want to merge\n>  the changes into my master branch, I cd back to the repo root and do\n>  \"git merge new_topic\"\n>\n>  That's where it breaks down.  The commits that I made go into the\n>  master repo itself, and the submodules don't have them.\n\nThere is something wrong with your story somewhere: submodules in git\neach have their own, completely independent,\nbranching/merging/pulling/pushing etc.  What makes you think the\nsubmodules are branching at the same time as your supermodule?\n\nPerhaps you have accidentally committed the *files* from your\nsubmodule into your supermodule, which means you're not using\ngit-submodule at all.\n\nHave fun,\n\nAvery\n"},{"id":"73663","messageId":"810a540e0804041307l665442eapcb5547343358df04@mail.gmail.com","threadId":"12985","inReplyTo":"32541b130804041302i1e32e4b3l141e8b08200a2357@mail.gmail.com","subject":"Re: Submodules and branches","fromName":"Pat Maddox","fromEmail":"pergesu@gmail.com","sentAt":"2008-04-04T20:07:16Z","receivedAt":"2008-04-04T20:07:16Z","isPatch":false,"sender":{"key":"pergesu@gmail.com","avatar":null},"body":"On Fri, Apr 4, 2008 at 1:02 PM, Avery Pennarun <apenwarr@gmail.com> wrote:\n> On 4/4/08, Pat Maddox <pergesu@gmail.com> wrote:\n>  > I've got a repository that uses submodules.  If I cd to the repo root\n>  >  and create a branch, all the submodules are switched to that branch as\n>  >  well.  All good so far.  I go into the submodules and do my work,\n>  >  committing as I go along.  Then when I'm all done and want to merge\n>  >  the changes into my master branch, I cd back to the repo root and do\n>  >  \"git merge new_topic\"\n>  >\n>  >  That's where it breaks down.  The commits that I made go into the\n>  >  master repo itself, and the submodules don't have them.\n>\n>  There is something wrong with your story somewhere: submodules in git\n>  each have their own, completely independent,\n>  branching/merging/pulling/pushing etc.  What makes you think the\n>  submodules are branching at the same time as your supermodule?\n>\n>  Perhaps you have accidentally committed the *files* from your\n>  submodule into your supermodule, which means you're not using\n>  git-submodule at all.\n\nHi Avery,\n\nYou're right, something was screwed up with the repo.  One of the\npaths was added as a submodule, but it also had files committed to it.\n I fixed all of that up and it seems to be fine now.\n\nPat\n"}]}