gpt4 book ai didi

git - 为什么我不能删除远程 GitLab 存储库中的分支?

转载 作者:IT王子 更新时间:2023-10-29 00:44:20 29 4
gpt4 key购买 nike

我正在尝试删除本地和远程 GitLab 存储库中的分支。它的名字是origin/feat。我尝试了 git push --delete origin feat。 Git 提示:

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/feat

OK 有道理,所以我尝试使用 git checkout master 切换到 origin/master,它告诉我:Already on 'master' .当前分支是否也需要在远程目录中设置?我该怎么做?

最佳答案

尝试

git push origin --delete feat

关于git - 为什么我不能删除远程 GitLab 存储库中的分支?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44657989/

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