-
Type:
Suggestion
-
Resolution: Unresolved
-
None
-
Component/s: None
-
None
-
0
-
1
Issue Summary
Upon deleting the default branch from the local machine repository there is a warning message from the remote repository which is misleading.
Environment
Git
Steps to Reproduce
- Create a repository in Bitbucket Server.
- Clone the repository to the local machine, perform changes and push to Bitbucket Server.
- Create another branch in Bitbucket Server and fetch the changes to the local repository.
- Delete the initial(master) branch from the local repository.
git push origin :master
Message
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 http://localhost:7990/scm/proj/repo.git ! [remote rejected] master (deletion of the current branch prohibited) error: failed to push some refs to 'http://admin@localhost:7990/scm/proj/repo.git'
Expected Results
The terminal in the local machine expected to show the following:
remote: error: refusing to delete the default branch: refs/heads/master To http://localhost:7990/scm/proj/repo.git
delete the default branch
Actual Results
The terminal in the local machine showing the following:
remote: error: refusing to delete the current branch: refs/heads/master
To http://localhost:7990/scm/proj/repo.git
delete the current branch
Currently, there is no known workaround for this behaviour. A workaround will be added here when available