code-gijoe
code-gijoe

Reputation: 7234

Is head always pointing to master on remote?

In this post, we explain that HEAD is a pointer. But I'm confused, I checked my repo and I have 'remotes/origin/master' and 'remotes/origin/HEAD'. Can we just point remote head to somewhere to that a user cloning a repo is already on another branch?

Upvotes: 1

Views: 603

Answers (1)

Shahbaz
Shahbaz

Reputation: 47533

See this answer. It points you to this article and this other answer. For a GitHub repository, you can also follow this answer.

In short, if you have access to the remote repository, you can do this on the remote repository itself:

git symbolic-ref HEAD refs/heads/mybranch

Or on GitHub, do so through the admin page.

Upvotes: 1

Related Questions