Reputation: 841
I'm not entirely sure of my process here, not too sure what I did or how it happened. But we've locally deleted the master branch on accident. And now the HEAD of the project has changed to a different branch.
I've tried to run the command-line of:
git remote set-head origin master
But this isn't setting the HEAD back to master, it's just showing a blank line. And if I try to test it with:
git remote show origin
It will return the same query of our new branch being the HEAD.
We have recovered the master branch, I see the master branch now as a regular branch off of my project. But it's no longer accepting all of our changes as HEAD, simply as a seperate branch from the HEAD.
How can I set master branch back to the HEAD of the project? Quite possibly via command-line as we have no access to Settings.
Upvotes: 2
Views: 77
Reputation: 6968
As mentioned in the comments, the most efficient way of doing this is using the RefLog. You can do this:
git update-ref refs/heads/master origin/master
git reset --hard master
This is another question referencing this method.
It sounds like your situation is similar to a detached head.
Upvotes: 1