Issue #2305
open
When irelativism tried to delete the master branch of contrib/irelativism/wiki-migration-scripts, it gave the following error:
$ git push origin --delete master
remote: error: By default, deleting the current branch is denied, because the next
remote: 'git clone' won't result in any file checked out, causing confusion.
remote:
remote: You can set 'receive.denyDeleteCurrent' configuration variable to
remote: 'warn' or 'ignore' in the remote repository to allow deleting the
remote: current branch, with or without a warning message.
remote:
remote: To squelch this message, you can set it to 'refuse'.
remote: error: refusing to delete the current branch: refs/heads/master
To ssh://git.replicant.us/contrib/irelativism/wiki-migration-scripts
! [remote rejected] master (deletion of the current branch prohibited)
error: failed to push some refs to 'ssh://git@git.replicant.us/contrib/irelativism/wiki-migration-scripts'
So it might be a good idea to look if it's possible for users to really delete the master branch.
A easy solution for this would be to set the default on main, so then problem presists but only with "main branches"
Also available in: Atom
PDF