zell
zell

Reputation: 10204

What are their differences, remotes/origin/HEAD, origin/main, and remotes/origin/main?

$ git branch -a

* main
  remotes/origin/HEAD -> origin/main
  remotes/origin/main

What are their differences:

Upvotes: 4

Views: 8324

Answers (1)

SwissCodeMen
SwissCodeMen

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

Related Questions