Short answer: origin
is a string of six characters. Whether it has any meaning anywhere depends on the "anywhere".
Longer answer: yes, origin
is a ref or something else.
OK, that's not long enough, so let's go a bit longer:
Some Git commands look for a remote. When you run git clone
, if you don't use the -o
option, you get a remote named origin
, so:
git remote show
will list origin
. That's a valid remote.
Some Git commands look for a commit specifier or a tree specifier or similar. Here, if you use a string of letters that cannot be mistaken for a hash ID, Git will go through the six-step resolution process outlined in the gitrevisions documentation. I'm not going to quote that documentation here, but note that one of the six steps looks to see if refs/remotes/name/HEAD
exists. If origin
is a valid remote, and git fetch
has run in the usual way, there is almost certainly a valid refs/remotes/origin/HEAD
that translates to a valid commit hash ID.
Hence origin
is a valid form of ref-name, when Git tries to use it as one. It's also a valid remote, when Git tries to use it as one.
Note that some Git commands look for both remote names and commit specifiers. In that case, origin
can be used in both positions and have both meanings:
git push origin origin:newbranch
for instance. The first origin
is a remote and the second is a ref.