Re: remote branches, and branch names in general
From: Jeff King <hidden>
Date: 2016-06-15 22:46:19
On Tue, Mar 03, 2009 at 10:52:21AM -0500, John Dlugosz wrote:
But I wonder if some commands work differently or specifically don't look in remotes. I "learned" to qualify everything when I accidently created a local branch named pub/xxx instead of using remotes/pub/xxx like I intended. I don't remember what that was, but I'm guessing that maybe refs that are a destination are different, as you are only supposed to change your local stuff. I think that was a "pull" command, before I had the automatic argument in the config file.
Yes, the "branch" command deals only with creating things in refs/heads, which are your local branches (similarly, "git tag" will only deal with stuff in refs/tags). So "git branch origin/foo" will make a ref "refs/heads/origin/foo", and "git branch -d origin/foo" will delete "refs/heads/origin/foo", not "refs/remotes/origin/foo". But when looking up a ref, the rules are used. So you can say: git branch master origin/master which will make "refs/heads/master" from "refs/remotes/origin/master". -Peff