From: Junio C Hamano Date: Mon, 10 Aug 2015 18:41:45 GMT Subject: Re: resolving a (possibly remote) branch HEAD to a hash Message-ID: In-Reply-To: <55c5aa2a.sK/tpvXyORYGVq0d%perryh@pluto.rain.com> perryh@pluto.rain.com (Perry Hutchison) writes: >> ... we do not say "append 'refs/remotes//' for various >> values of and see if such a ref exists" when resolving >> an abbreviated refname 'master'. > > checkout appears to. You are referring to this part of the documentation: If is not found but there does exist a tracking branch in exactly one remote (call it ) with a matching name, treat as equivalent to $ git checkout -b --track / A reader needs to read this part of the documentation a bit more carefully in order to notice that it never says it is equivalent to: $ git checkout -b -t ;# NOT CORRECT This behaviour was brought in by somebody who thought that, in the context of "checkout" (and only in that context), it is clear that missing that can only mean the sole / and make that signal something more than what the user told "checkout" to do: "If you want to check out a , and it does not exist yet, you must wanted to create your own and start it at the same commit as somebody else has at the tip of his ". This "clever" dwim is very specific to the way you interact with "checkout" and generally does not apply when you want to run anything other than "checkout", e.g. "rev-parse" or "log". But it is _so_ convenient a short-cut, that it lets new people form into an illusion that could be naming /. That is an incorrect perception. The rationale behind "signal something more" above goes like this: if the user wanted to detach the head at the same commit as somebody else's , she would explicitly have written $ git checkout / to do so. Because / is the shortest valid way to name that remote-tracking branch (i.e. exactly because is not a valid abbreviation for /), we can treat $ git checkout when is not a local branch name specially. It is sad and ironic that this checkout-specific DWIM works only because does not mean /, but presence of the DWIM gives a wrong illusion that it does X-<.