Re: remote branches, and branch names in general
- From
Jeff King <peff@peff.net>
- Date
- Mar 3, 2009, 16:11 UTC
- Message-ID
- <20090303161117.GB32079@coredump.intra.peff.net>
- In-Reply-To
- <450196A1AAAE4B42A00A8B27A59278E709F075DF@EXCHANGE.trad.tradestation.com>
On Tue, Mar 03, 2009 at 10:52:21AM -0500, John Dlugosz wrote:
Show 7 quoted lines
> 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