Reputation: 10204
$ git branch -a
* main
remotes/origin/HEAD -> origin/main
remotes/origin/main
What are their differences:
remotes/origin/HEAD
origin/main
remotes/origin/main
Upvotes: 4
Views: 8324
Reputation: 4895
The remotes/origin/HEAD
is the branch currently checked out in the origin
repository, which means if you clone that repository, by default that branch will be checked out first.
The origin/main
is a remote branch (which is a local copy of the branch named main
on the remote named origin
)
The remotes/origin/main
, usually referred to as origin/main
, is the location of a branch called main
on the remote called origin
the last time you did a git command. If they're related, main
will have origin/main
as its upstream.
Look at this question too: master vs. origin/master vs. remotes/origin/master
Upvotes: 2