The error message you're seeing is because you're trying to delete the branch that is currently checked out on the remote repository. Git prevents this by default to avoid confusion and potential data loss.
The `receive.denyDeleteCurrent` configuration variable you're trying to set is for the remote repository, not your local one. Setting it on your local repository with `git config --local receive.denyDeleteCurrent ignore` won't have any effect on the remote repository. Unfortunately, SourceForge's Git service doesn't provide a way to directly change this setting or to change the default branch via their web interface, unlike some other Git hosting services like GitHub or GitLab. Here's a workaround you can try: 1. Push your new branch to the remote repository, if you haven't already: ```bash git push origin default ``` 2. On your local machine, create a temporary branch and check it out: ```bash git checkout -b temp ``` 3. Push the temporary branch to the remote repository: ```bash git push origin temp ``` 4. On SourceForge, go to your project's Admin settings, then to the Tool Configuration for Git. Set the default branch to `temp`. 5. Now you should be able to delete the `master` branch: ```bash git push origin --delete master ``` 6. Finally, go back to the Tool Configuration for Git on SourceForge and change the default branch to `default`. You can then delete the `temp` branch if you wish. Remember to inform any collaborators to fetch the latest changes and switch to the new default branch. Στις Παρ 29 Δεκ 2023 στις 6:38 μ.μ., ο/η Uwe Brauer <o...@mat.ucm.es> έγραψε: > > Hi > > I just set up a sandbox (clone of the true repository) > > I tried out the following > 1. git branch -m master default > 2. Change the «gitlab-default» branch to something else > > 3. git push origin --delete master > > 4. git push origin -u default > 5. Set the default branch as «gitlab-default» > > However 3. Fails with > > > ,---- > | 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.code.sf.net/p/matlab-emacs-mirror/code > | ! [remote rejected] master (deletion of the current branch prohibited) > | error: failed to push some refs to 'ssh:// > git.code.sf.net/p/matlab-emacs-mirror/code' > `---- > > But I tried out > git config --local receive.denyDeleteCurrent ignore > > And it did not help. > > Any idea what is going wrong here. > On gitlab I have to change the default branch form master to something > else via their webinterface. > > I don't see anything like this on sourceforge. > > Any ideas? > > Regards > > Uwe > -- > I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel > I strongly condemn Putin's war of aggression against Ukraine. > I support to deliver weapons to Ukraine's military. > I support the EU and NATO membership of Ukraine. > > -- > You received this message because you are subscribed to the Google Groups > "Git for human beings" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to git-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/git-users/87bka83o4a.fsf%40mat.ucm.es. > -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/git-users/CA%2B-wtNtp6bh3qfMf4AyZxET7MBd__9vHWNieSxKkm7J%3DacJGqg%40mail.gmail.com.