How to rename the master branch when using gitolit

I am using gitolite to manage git permissions.

I want to rename master branch to production.

I have RW + permission on this repo in gitolit

I am renaming the local branch with:

git branch -m master production

and then I want to share the remote master branch, but I get:

remote: error: By default, deleting the current branch is denied, because the next
remote: error: 'git clone' won't result in any file checked out, causing confusion.
remote: error:
remote: error: You can set 'receive.denyDeleteCurrent' configuration variable to
remote: error: 'warn' or 'ignore' in the remote repository to allow deleting the
remote: error: current branch, with or without a warning message.
remote: error:
remote: error: To squelch this message, you can set it to 'refuse'.
remote: error: refusing to delete the current branch: refs/heads/master
To gitolite@virgo:/puppeteer
 ! [remote rejected] master (deletion of the current branch prohibited)

      

How can I delete the master branch also on the remote?

+3


source to share


1 answer


The question is why are you deleting the master branch. Its much easier to create a new branch and push the new branch to your remote server.

git checkout master
git branch production
git checkout production
git push origin production

      



Then you have a new remote branch.

+1


source







All Articles