Re: setting up tracking on push

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

 



On Wed, Mar 11, 2009 at 9:14 PM, Jay Soffian <jaysoffian@xxxxxxxxx> wrote:
> - Local branches can be associated with remote tracking branches in
> the repo's config (.git/config). This association is done
> automatically in current git when creating a new local branch based on
> a remote tracking branch (e.g, git checkout -b topic origin/master or
> git branch topic origin/master). (You can use --track and --no-track
> to be explicit about whether or not you want the association to
> happen.)
>
> The association itself is simply an entry in the repo's .git/config. e.g.:
>
> [branch "topic"]
>        remote = origin
>        merge = refs/heads/master

As Junio points out, a local branch can be associated with another
local branch, not just a remote-tracking branch. In the config, this
looks like:

[branch "topic"]
      remote = .
      merge = refs/heads/master

So now "topic" is associated with *local* branch master, not
remote-tracking branch master, and this is because "remote = ." means
"this repo right here".

But, when making a new branch based on a local branch via git branch
and git checkout, adding this association in the config is not the
default. You have to explicitly ask for it with --track.

Also, the default of whether or not to add the association can itself
be changed. See the entry for branch.autosetupmerge (and related
branch.autosetuprebase, which I didn't go into) in "git help config".

j.
--
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