gpt4 book ai didi

git - 使用gitolite时如何重命名主分支

转载 作者:太空狗 更新时间:2023-10-29 14:19:04 33 4
gpt4 key购买 nike

我正在使用 gitolite 进行 git 访问权限管理。

我想将 master 分支重命名为 production。

我对 gitolite 中的那个 repo 有 RW+ 权限

我将本地分支重命名为:

git branch -m 主生产

然后我想删除远程主分支,但我得到:

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)

如何在远程删除主分支?

最佳答案

问题是为什么要删除 master 分支。创建一个新分支并将新分支推送到您的远程服务器要容易得多。

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

然后你就有了一个新的远程分支。

关于git - 使用gitolite时如何重命名主分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26336902/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com