0

What is the use of setting the origin/HEAD using the git remote set-head command, if it is only a local reference? I read somewhere that it is the branch checked out by default when we clone, but how does that work if it's only local?

  • [Docs](https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emset-headem): “Having a default branch for a remote is not required, but allows the name of the remote to be specified in lieu of a specific branch. For example, if the default branch for origin is set to master, then origin may be specified wherever you would normally specify origin/master.” – JBallin Jun 27 '22 at 21:37
  • Posted as an answer given that you suggested that the excerpt satisfied your inquiry. – JBallin Jun 27 '22 at 23:07

1 Answers1

0

Docs:

Having a default branch for a remote is not required, but allows the name of the remote to be specified in lieu of a specific branch. For example, if the default branch for origin is set to master, then origin may be specified wherever you would normally specify origin/master.

JBallin
  • 8,481
  • 4
  • 46
  • 51