From: Jay Soffian Date: Wed, 11 Mar 2009 01:52:44 GMT Subject: Re: setting up tracking on push Message-ID: <76718490903101852y2c90e0abi8e0e4f71e6f0bc52@mail.gmail.com> In-Reply-To: <20090310230939.GB14083@sigio.peff.net> On Tue, Mar 10, 2009 at 7:09 PM, Jeff King wrote: > On Tue, Mar 10, 2009 at 04:26:03PM -0400, Marc Branchaud wrote: > >> It would be good if the branch command allowed modification of a >> branch's properties.  At the very least, branch-creation commands like >> "git branch --track foobranch origin/master" could offer to modify if >> the branch already exists, instead of just quitting. > > I agree that it would be nice if an interface could be made around > "branch --track". However, the problem with > >  git branch --track foobranch origin/master > > is that it does two things: it sets up tracking, and it resets the > foobranch ref. Right now we complain if foobranch already exists. We > have a "-f" to override. But what you want to say is "set foobranch to > track origin/master, but _don't_ actually reset where it points". And I > don't see an intuitive way of doing that with that syntax. If you don't > require "-f", then you are silently ignoring half of what the user asked > you to do. Maybe a new switch, say -u for update: -u --track [] Update tracking information for an existing branch. is optional and defaults to the current branch. is the branch you wish to track, e.g. origin/master; normally is a remote tracking branch, but specifying a local branch is valid as well. -u --no-track [] Remove tracking information for an existing branch. is optional and defaults to the current branch. j.