I’m experimenting with some githooks, so I have setup a local bare repository with a symlink from hooks to the hooks stored elsewhere.
I have pushed the master branch to the git repo and, of course, the hook failed. 🙂
I want to reset the git repo to nothing, without deleting it and having to recreate the symlink etc.
How do I delete the master branch, seeing as it is the only branch in the repository?
$ git branch -d master
error: Cannot delete the branch 'master' which you are currently on.
To remove the
masterref, usegit update-ref -d refs/heads/master.Why shouldn’t you
rm /refs/heads/master?packed-refscould exist, sormsometimes doesn’t work as expected.BTW, what’s the point to reset if you could just create a new empty repo instead? Just use
git init --bare repo.git.