Re: Terminology question about remote branches.

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

 



On Sat, 04 Aug 2007 16:01:55 +0200
David Kastrup <dak@xxxxxxx> wrote:

> So --track does not set up a tracking branch, but makes a local
> _following_ branch _refer_ to a tracking branch.

Sure, that's one way to describe it; perhaps it would be best if
we switched to that nomenclature in the documentation.

> What happens with
> 
>     git checkout origin/branchX
>     git branch --track mylocalbranch
>     git checkout mylocalbranch

This is easy to test, and the answer is that no tracking is set up.
You must supply the remote-tracking-branch on the command line with
the --track option to git branch.  Actually I realized that with a
new enough version of Git, --track is implied.

> ?  What if after the checkout (which leads to a detached head) I check
> in a few things, and then decide to name the branch and set it up as
> following a remote tracking branch?  Instead of using git-branch for
> setting up the following, do I have to explicitly add the respective
> "remote" line (which does not specify a remote, but a remote tracking
> branch) into, uh, where?

It's not a problem, you could just add an appropriate [branch...] section
in your .git/config.   Actually looking at a typical branch section
is even more confusing to me:

    $ git branch fudge origin/fix1

adds this to the .git/config:

    [branch "fudge"]
        remote = origin
        merge = refs/heads/fix1

The config file does not record the remote-tracking-branch, instead
it explicitly records the remote repository information.  So it sure
appears that if you add the --track option, it _does_ make the local
branch track a remote directly.  Thus it's hard to call it anything
but what you labelled it,  a local tracking-branch.

While I thought i had a handle on this, i'm now officially more
confused than you; hopefully someone with knowledge of the guts
of Git will speak up.   Junio Help!

Sean
-
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