{"thread":{"id":"22044","subject":"config for merging master to test branch","startedAt":"2009-12-28T23:38:39Z","lastAt":"2009-12-29T18:32:51Z","messageCount":5,"participants":["Daniel Convissor","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"130430","messageId":"20091228233838.GA28052@panix.com","threadId":"22044","inReplyTo":null,"subject":"config for merging master to test branch","fromName":"Daniel Convissor","fromEmail":"danielc@analysisandsolutions.com","sentAt":"2009-12-28T23:38:39Z","receivedAt":"2009-12-28T23:38:39Z","isPatch":false,"sender":{"key":"danielc@analysisandsolutions.com","avatar":"https://gravatar.com/avatar/6934d176616faccef0fe2329329c24e2a2d92783d565704c7c4f85ea9219d412?d=mp&s=160"},"body":"Hello:\n\nHere's my workflow...\n\ntesting directory (test branch)\n    [set origin to server repository]\n    git pull\n    git branch test\n    git checkout test\n    [edit settings files]\n    git commit ...\n\nworking directory (master branch)\n    [set origin to server repository]\n    [make changes]\n    git commit ...\n    git push origin master\n\nNow, here's the question.  I want to go back into the testing directory \nand do a \"git pull\" and have the changes from master automatically merged \ninto my test branch in one step, without having to do an explicit set of \ncheckouts and merges.  I get the impression there are configuration \nsettings that allow such to be done.  Is my impression correct?  If so, \nwhat are the explicit configuration commands, please?  Or is there some \ncommand other than \"pull\" I should be using to do this?\n\nThanks,\n\n--Dan\n\n-- \n T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y\n            data intensive web and database programming\n                http://www.AnalysisAndSolutions.com/\n 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409\n"},{"id":"130465","messageId":"20091229164343.GA17546@panix.com","threadId":"22044","inReplyTo":"20091228233838.GA28052@panix.com","subject":"Re: config for merging master to test branch","fromName":"Daniel Convissor","fromEmail":"danielc@analysisandsolutions.com","sentAt":"2009-12-29T16:43:44Z","receivedAt":"2009-12-29T16:43:44Z","isPatch":false,"sender":{"key":"danielc@analysisandsolutions.com","avatar":"https://gravatar.com/avatar/6934d176616faccef0fe2329329c24e2a2d92783d565704c7c4f85ea9219d412?d=mp&s=160"},"body":"Hello Again Folks:\n\nOn Mon, Dec 28, 2009 at 06:38:39PM -0500, Daniel Convissor wrote:\n> \n> Now, here's the question.  I want to go back into the testing directory \n> and do a \"git pull\" and have the changes from master automatically merged \n> into my test branch in one step, without having to do an explicit set of \n> checkouts and merges.\n\nI found this is possible by being in the \"test\" checkout and calling\n\"git pull origin master\".  Is this the best way to do it?\n\nThanks,\n\n--Dan\n\n-- \n T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y\n            data intensive web and database programming\n                http://www.AnalysisAndSolutions.com/\n 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409\n"},{"id":"130466","messageId":"7vvdfphgbu.fsf@alter.siamese.dyndns.org","threadId":"22044","inReplyTo":"20091229164343.GA17546@panix.com","subject":"Re: config for merging master to test branch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-29T16:53:41Z","receivedAt":"2009-12-29T16:53:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Convissor <danielc@analysisandsolutions.com> writes:\n\n> On Mon, Dec 28, 2009 at 06:38:39PM -0500, Daniel Convissor wrote:\n>> \n>> Now, here's the question.  I want to go back into the testing directory \n>> and do a \"git pull\" and have the changes from master automatically merged \n>> into my test branch in one step, without having to do an explicit set of \n>> checkouts and merges.\n>\n> I found this is possible by being in the \"test\" checkout and calling\n> \"git pull origin master\".  Is this the best way to do it?\n\nGood.  That is how it was designed to be used ;-)\n\nIf you feel lazy and want to omit typing \" origin master\", you could add a\nfew configuration items in your .git/config in the test repository.\n\n    [branch \"test\"]\n        remote = origin\n        merge = refs/heads/master\n\nThat configures git in such a way that...\n\n    When on branch \"test\", \"pull\" and \"fetch\" by default interact with the\n    \"origin\" repository, and \"pull\" integrates what was found on the\n    'master' branch from that remote into your history.\n"},{"id":"130473","messageId":"20091229175607.GA3683@panix.com","threadId":"22044","inReplyTo":"7vvdfphgbu.fsf@alter.siamese.dyndns.org","subject":"Re: config for merging master to test branch","fromName":"Daniel Convissor","fromEmail":"danielc@analysisandsolutions.com","sentAt":"2009-12-29T17:56:08Z","receivedAt":"2009-12-29T17:56:08Z","isPatch":false,"sender":{"key":"danielc@analysisandsolutions.com","avatar":"https://gravatar.com/avatar/6934d176616faccef0fe2329329c24e2a2d92783d565704c7c4f85ea9219d412?d=mp&s=160"},"body":"Hi Junio:\n\n> Good.  That is how it was designed to be used ;-)\n\nThanks for the reassurance.\n\n\n>     [branch \"test\"]\n>         remote = origin\n>         merge = refs/heads/master\n> \n>     When on branch \"test\", \"pull\" and \"fetch\" by default interact with the\n>     \"origin\" repository, and \"pull\" integrates what was found on the\n>     'master' branch from that remote into your history.\n\nExcellent.  Initially, I wasn't sure what the following commands did:\n\n   git config branch.test.remote origin\n   git config branch.test.merge refs/heads/master\n\nBetween further reading and your explanation I now understand it better. \n\"refs/heads/master\" refers items displayed by \"git show-ref\".\n\nSo what is \"refs/remotes/origin/master\", please?\n\nThanks,\n\n--Dan\n\n-- \n T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y\n            data intensive web and database programming\n                http://www.AnalysisAndSolutions.com/\n 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409\n"},{"id":"130474","messageId":"7vskatd418.fsf@alter.siamese.dyndns.org","threadId":"22044","inReplyTo":"20091229175607.GA3683@panix.com","subject":"Re: config for merging master to test branch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-29T18:32:51Z","receivedAt":"2009-12-29T18:32:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Convissor <danielc@analysisandsolutions.com> writes:\n\n> Excellent.  Initially, I wasn't sure what the following commands did:\n>\n>    git config branch.test.remote origin\n>    git config branch.test.merge refs/heads/master\n>\n> Between further reading and your explanation I now understand it better. \n> \"refs/heads/master\" refers items displayed by \"git show-ref\".\n\nNot quite.  refs/heads/master there refers to the _local_ master branch,\nbut it is _local_ with respect to the origin repository, not your\nrepository.  \"git show-ref\" is about showing refs in _your_ repository.\n\n> So what is \"refs/remotes/origin/master\", please?\n\n    http://gitster.livejournal.com/30313.html\n\nIf you read Japanese, you may also want to read Ch.13 of my book ;-)\n\nThe refs/remotes/ hierarchy is used to store a copy of the branch tips\nfetched from the named remotes (like \"origin\").\n"}]}