{"thread":{"id":"24387","subject":"Git branch","startedAt":"2010-07-13T22:50:52Z","lastAt":"2010-07-13T23:04:18Z","messageCount":2,"participants":["jhapk","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"145483","messageId":"1279061452603-5290193.post@n2.nabble.com","threadId":"24387","inReplyTo":null,"subject":"Git branch","fromName":"jhapk","fromEmail":"pradeep.kumar.jha@gmail.com","sentAt":"2010-07-13T22:50:52Z","receivedAt":"2010-07-13T22:50:52Z","isPatch":false,"sender":{"key":"pradeep.kumar.jha@gmail.com","avatar":null},"body":"\nHi,\n\nI have a central bare repository B and two non-bare repositories A1 and A2.\nBoth A1 and A2 have B as the origin. The way I do it is that every time I\ncreate a branch in A1, say branchA, I manually enter the following lines in\nthe .git/config files of A1 and A2\n[branch \"branchA\"]\n    remote = origin\n    merge = refs/heads/branchA\n\nThen I create a branch in the bare repository B called branchA. Once this is\ndone, all the push and pull works smoothly between the two repositories. \n\nJust wondering, is there a better way to do this? :)\n-- \nView this message in context: http://git.661346.n2.nabble.com/Git-branch-tp5290193p5290193.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"145486","messageId":"20100713230418.GA1818@burratino","threadId":"24387","inReplyTo":"1279061452603-5290193.post@n2.nabble.com","subject":"Re: Git branch","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-13T23:04:18Z","receivedAt":"2010-07-13T23:04:18Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\njhapk wrote:\n\n> I manually enter the following lines in\n> the .git/config files of A1 and A2\n> [branch \"branchA\"]\n>     remote = origin\n>     merge = refs/heads/branchA\n> \n> Then I create a branch in the bare repository B called branchA. Once this is\n> done, all the push and pull works smoothly between the two repositories. \n> \n> Just wondering, is there a better way to do this? :)\n\nMaybe something like the following would work.\n\n>From A1:\n\n  git checkout -b branchA\n  ... hack hack hack ...\n  git push --set-upstream origin branchA\n  ssh A2\n\n>From A2:\n\n  git checkout -t origin/branchA\n"}]}