You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
In origin, I have two branches - default and master.
Currently, the HEAD in origin points to the branch named 'default', but the branch called master is defined as the MAIN branch.
So, how can I move the HEAD on the origin from the default branch to the master branch?
Hi @Dmitry Leyzerovich and welcome to the community!
Could you please provide some more details as to where exactly you see the HEAD of the remote repo?
Are you perhaps referring to the reference located in .git/refs/remotes/origin/HEAD in your clone of the repo?
If so, this reference is set when you clone the repo, and a git fetch doesn't update it if you change the main branch after you clone.
If you changed the main branch after cloning the repo, you can use the following command to update this specific ref locally:
git remote set-head origin -a
This will work if the ref refs/remotes/origin/master exists already locally (otherwise you need to fetch it first).
See here for reference: https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emset-headem