{"thread":{"id":"21976","subject":"how can I push a sub-tree","startedAt":"2009-12-17T09:50:05Z","lastAt":"2009-12-18T02:05:13Z","messageCount":4,"participants":["Zhi Li","Tay Ray Chuan"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"130024","messageId":"2986b3940912170150o17118a07i8f91e785c08e2ac9@mail.gmail.com","threadId":"21976","inReplyTo":null,"subject":"how can I push a sub-tree","fromName":"Zhi Li","fromEmail":"lizhi1215@gmail.com","sentAt":"2009-12-17T09:50:05Z","receivedAt":"2009-12-17T09:50:05Z","isPatch":false,"sender":{"key":"lizhi1215@gmail.com","avatar":"https://gravatar.com/avatar/046f41bb43caa87c4206bc2de47356fbba43609f6716008d0940c0ec9e4c6c4e?d=mp&s=160"},"body":"Hi,\n\nI tried to find a way to push a sub-tree. In section 6.7 of \"Pro Git\",\nthere's a way for pulling a git sub-tree. But I have not found the\nopposite: push a git sub-tree. Can someone help me?\n\nBTW, I appologize for not reading archives of this list.\n\nZhi\n"},{"id":"130025","messageId":"be6fef0d0912170214u433769e3ucf8180022aa72fb3@mail.gmail.com","threadId":"21976","inReplyTo":"2986b3940912170150o17118a07i8f91e785c08e2ac9@mail.gmail.com","subject":"Re: how can I push a sub-tree","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-12-17T10:14:00Z","receivedAt":"2009-12-17T10:14:00Z","isPatch":false,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Thu, Dec 17, 2009 at 5:50 PM, Zhi Li <lizhi1215@gmail.com> wrote:\n> I tried to find a way to push a sub-tree. In section 6.7 of \"Pro Git\",\n> there's a way for pulling a git sub-tree. But I have not found the\n> opposite: push a git sub-tree. Can someone help me?\n\nI've not read the book, but perhaps you mean submodules?\n\nIf so, refer to the part in the git submodule tutorial that describes\nhow to make changes within a submodule on the GitWiki at\nhttp://git.or.cz/gitwiki/GitSubmoduleTutorial.\n\n-- \nCheers,\nRay Chuan\n"},{"id":"130053","messageId":"2986b3940912171655t397f90b2tf28bac3555181292@mail.gmail.com","threadId":"21976","inReplyTo":"be6fef0d0912170214u433769e3ucf8180022aa72fb3@mail.gmail.com","subject":"Re: how can I push a sub-tree","fromName":"Zhi Li","fromEmail":"lizhi1215@gmail.com","sentAt":"2009-12-18T00:55:39Z","receivedAt":"2009-12-18T00:55:39Z","isPatch":false,"sender":{"key":"lizhi1215@gmail.com","avatar":"https://gravatar.com/avatar/046f41bb43caa87c4206bc2de47356fbba43609f6716008d0940c0ec9e4c6c4e?d=mp&s=160"},"body":"Hi,\n\nNot sub-module, but sub-tree.\n\nMy problems are:\n$ git remote add rack_remote git@github.com:schacon/rack.git\n$ git fetch rack_remote\n$ git branch rack_branch rack_remote/master\n$ git read-tree --prefix=rack/ -u rack_branch\n\nNow in master branch, I have a sub-tree rack. Later I modified\nsomething in rack sub-tree. Then, how could I push my changes to\nrack_remote?\n\nThanks\nZhi\n\nOn Thu, Dec 17, 2009 at 6:14 PM, Tay Ray Chuan <rctay89@gmail.com> wrote:\n> Hi,\n>\n> On Thu, Dec 17, 2009 at 5:50 PM, Zhi Li <lizhi1215@gmail.com> wrote:\n>> I tried to find a way to push a sub-tree. In section 6.7 of \"Pro Git\",\n>> there's a way for pulling a git sub-tree. But I have not found the\n>> opposite: push a git sub-tree. Can someone help me?\n>\n> I've not read the book, but perhaps you mean submodules?\n>\n> If so, refer to the part in the git submodule tutorial that describes\n> how to make changes within a submodule on the GitWiki at\n> http://git.or.cz/gitwiki/GitSubmoduleTutorial.\n>\n> --\n> Cheers,\n> Ray Chuan\n>\n"},{"id":"130054","messageId":"2986b3940912171805s6cbdb974u31f1b8ef5c65b7c7@mail.gmail.com","threadId":"21976","inReplyTo":"2986b3940912171655t397f90b2tf28bac3555181292@mail.gmail.com","subject":"Re: how can I push a sub-tree","fromName":"Zhi Li","fromEmail":"lizhi1215@gmail.com","sentAt":"2009-12-18T02:05:13Z","receivedAt":"2009-12-18T02:05:13Z","isPatch":false,"sender":{"key":"lizhi1215@gmail.com","avatar":"https://gravatar.com/avatar/046f41bb43caa87c4206bc2de47356fbba43609f6716008d0940c0ec9e4c6c4e?d=mp&s=160"},"body":"Hi,\n\nI found a way to do it, but I do not know whether it is the simplest.\n\nIn master branch, run \"git cat-file -p\" several times to find rack\nsub-tree sha. Then check-out branch \"rack_branch\", run \"git read-tree\nsha\". The sha is that one just get by \"git cat-file -p\". Finally,\ngit-commit, git-push...\n\nCheers,\nZhi\n\nOn Fri, Dec 18, 2009 at 8:55 AM, Zhi Li <lizhi1215@gmail.com> wrote:\n> Hi,\n>\n> Not sub-module, but sub-tree.\n>\n> My problems are:\n> $ git remote add rack_remote git@github.com:schacon/rack.git\n> $ git fetch rack_remote\n> $ git branch rack_branch rack_remote/master\n> $ git read-tree --prefix=rack/ -u rack_branch\n>\n> Now in master branch, I have a sub-tree rack. Later I modified\n> something in rack sub-tree. Then, how could I push my changes to\n> rack_remote?\n>\n> Thanks\n> Zhi\n>\n> On Thu, Dec 17, 2009 at 6:14 PM, Tay Ray Chuan <rctay89@gmail.com> wrote:\n>> Hi,\n>>\n>> On Thu, Dec 17, 2009 at 5:50 PM, Zhi Li <lizhi1215@gmail.com> wrote:\n>>> I tried to find a way to push a sub-tree. In section 6.7 of \"Pro Git\",\n>>> there's a way for pulling a git sub-tree. But I have not found the\n>>> opposite: push a git sub-tree. Can someone help me?\n>>\n>> I've not read the book, but perhaps you mean submodules?\n>>\n>> If so, refer to the part in the git submodule tutorial that describes\n>> how to make changes within a submodule on the GitWiki at\n>> http://git.or.cz/gitwiki/GitSubmoduleTutorial.\n>>\n>> --\n>> Cheers,\n>> Ray Chuan\n>>\n>\n"}]}