Switch current branch in git bare repository May 17, 2023 by Tarik Try this instead of git checkout: git symbolic-ref HEAD refs/heads/develop Then you should be able to delete master.