{"thread":{"id":"17233","subject":"easy way to make tracking branches?","startedAt":"2009-01-18T10:55:30Z","lastAt":"2009-01-18T15:53:38Z","messageCount":3,"participants":["Stephan Beyer","Sitaram Chamarty"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"100947","messageId":"20090118105530.GG11992@leksak.fem-net","threadId":"17233","inReplyTo":null,"subject":"easy way to make tracking branches?","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2009-01-18T10:55:30Z","receivedAt":"2009-01-18T10:55:30Z","isPatch":false,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nassume I have a branch \"foo\" in my local repo, a remote \"srv\", and\na branch \"bar\" on srv (i.e. generated with \"git push srv foo:bar\").\n\nNow I want to make \"foo\" a tracking branch for \"bar\".\nI do:\n\n\tgit config branch.foo.remote srv\n\tgit config branch.foo.merge refs/heads/bar\n\nAnd to get a comfortable git-push, I do:\n\n\tgit config --add remote.srv.push foo:bar\n\n\nBecause I do not always remember the sequence, I have to look it\nup or I just do\n\n\tgit checkout -b foo2 srv/bar\n\tgit branch -d foo\n\tgit branch -m foo\n\nwhich is suboptimal because deleting foo can remove some\nother settings for the branch, e.g. mergeoptions.\n\n\nSo I wonder if there is some easier-to-remind way to let my branch\nfoo track my remote branch bar, or, if not, could it be useful to\nhave something like\n\n\tgit push --make-tracking srv foo:bar\n\t# push foo -> bar and let foo track bar...\n\t# if foo already tracks bar, ignore the option\n\nor should I just write a tiny script for me and shut up? :-)\n\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"101004","messageId":"slrngn6j4t.9he.sitaramc@sitaramc.homelinux.net","threadId":"17233","inReplyTo":"20090118105530.GG11992@leksak.fem-net","subject":"Re: easy way to make tracking branches?","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2009-01-18T15:37:01Z","receivedAt":"2009-01-18T15:37:01Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On 2009-01-18, Stephan Beyer <s-beyer@gmx.net> wrote:\n> Now I want to make \"foo\" a tracking branch for \"bar\".\n> I do:\n>\n> \tgit config branch.foo.remote srv\n> \tgit config branch.foo.merge refs/heads/bar\n\nI just do a \"git pull srv\" when the tracking is *not* setup,\nand git reminds me what commands to use.\n\n> And to get a comfortable git-push, I do:\n>\n> \tgit config --add remote.srv.push foo:bar\n\nThis one you'll just have to remember, I guess :-)\n\n> \tgit checkout -b foo2 srv/bar\n> \tgit branch -d foo\n> \tgit branch -m foo\n>\n> which is suboptimal because deleting foo can remove some\n> other settings for the branch, e.g. mergeoptions.\n\nit also doesn't seem to set remote.srv.push, as far as I can\ntell.\n"},{"id":"101008","messageId":"20090118155338.GK11992@leksak.fem-net","threadId":"17233","inReplyTo":"slrngn6j4t.9he.sitaramc@sitaramc.homelinux.net","subject":"Re: easy way to make tracking branches?","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2009-01-18T15:53:38Z","receivedAt":"2009-01-18T15:53:38Z","isPatch":false,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nSitaram Chamarty wrote:\n> > Now I want to make \"foo\" a tracking branch for \"bar\".\n> > I do:\n> >\n> > \tgit config branch.foo.remote srv\n> > \tgit config branch.foo.merge refs/heads/bar\n> \n> I just do a \"git pull srv\" when the tracking is *not* setup,\n> and git reminds me what commands to use.\n\nOh, this is great! (Just tested.)\n\nUsually (in my use case) there is no need to pull before I set up\na tracking branch, so I never tried this.\n\nAnd git only reminds you if you have no tracking branch set for\nsrv yet. But that's no problem, because if one is set I can\ncopy&paste the lines in .git/config.\n\nAltogether, this is a solution I can live with.\n\n> > And to get a comfortable git-push, I do:\n> >\n> > \tgit config --add remote.srv.push foo:bar\n> \n> This one you'll just have to remember, I guess :-)\n\nThis is not too hard. :-)\n\n> > \tgit checkout -b foo2 srv/bar\n> > \tgit branch -d foo\n> > \tgit branch -m foo\n> >\n> > which is suboptimal because deleting foo can remove some\n> > other settings for the branch, e.g. mergeoptions.\n> \n> it also doesn't seem to set remote.srv.push, as far as I can\n> tell.\n\nRight.\n\n\nThanks,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"}]}