Hi All,
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?
Thank you!
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
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.