2009/6/18 Jakub Narebski <jnareb@xxxxxxxxx>: > On Thu, 18 June 2009, Santi Béjar wrote: >> 2009/6/18 Jakub Narebski <jnareb@xxxxxxxxx>: > > [cut] >> > >> > $ git remote tracking <remote> <remote branch> >> > >> > would show all local branches that track <remote branch>, and have >> > <remote> as default remote, >> >> Maybe my description is unclear, but it's not about local branches >> which track <branch> on <remote>, it is about the local branch >> representation of the remote branch, i.e. not 'master' but >> origin/master (git remote tracking origin master in a default clone). > > Ah, the problem with the same (or similar) name for two different > things. If we have local branch 'local' set to track branch 'master' > on remote 'origin', we have: > > /------- local repository ------\ /- origin -\ > / \ / \ > | | | | > 'local' --------> 'origin/master' -----------> 'master' > refs/heads/local refs/remotes/origin/master refs/heads/master > > branch.local.remote = origin > branch.local.merge = refs/heads/master > > remote.origin.fetch = +refs/heads/*:refs/remotes/origin/* > > 'origin/master' is called remote-TRACKING branch (for 'master' branch > on remote 'origin'). Setting up automerge information for local branch > 'local' which _follows_ branch 'master' on remote 'origin' is done > using --TRACK option to git-branch. > > Therefore the confusion. OK, but I wonder if the documentation for the new command is clear enough or can be improved. > > > Do I understand correctly that you want for > > $ git remote tracking origin master > > to return > > origin/master In this particular case (the above settings) not exactly, as master does not match exactly the lhs of the refspec. It would be: $ git remote tracking origin refs/heads/master refs/remotes/origin/master > > (and perhaps also origin/HEAD?). HEAD is another beast, as the local HEAD symlink is a local config, that defaults to the remote default branch, but that you can change with "git remote set-head". Ops, you are saying to return origin/HEAD for "git remote tracking origin master", no? I don't think it makes sense, I think of "git remote tracking" more as a mapping function, it applies the map (the refspec) to the given argument. Santi -- 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