Re: setting up tracking on push

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

> BTW, I think the following (untested) incantation adds tracking to a branch:
>
> 	git config branch.foobranch.remote origin
> 	git config branch.foobranch.merge refs/heads/master

Yes, that is right. The only reason it is not a two-line script to
convert "git branch --track" into that is that you have to actually
resolve origin/master into "remote origin, branch refs/heads/master".

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux