I'm trying to delete a branch both locally and in a remote GitLab repository. Its name is origin/feat
. I tried git push --delete origin feat
. Git complains:
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/feat
OK makes sense, so I tried switching to origin/master
with git checkout master
and it tells me: Already on 'master'
. Does the current branch also need to be set in the remote directory? How would I do that?