Gitlab 不允许我强制推送,因为分支受到保护。除了强制推送,我还能做什么?

问题描述 投票:0回答:0

我错误地将一些东西推入了远程仓库。 现在我想返回一个提交然后强制推送它,以更正它。

>>git reset HEAD~
>>git push -f
remote: GitLab: You are not allowed to force push code to a protected branch on this project.
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push

而不是取消 Gitlab 中的保护并尝试再次强制推送,似乎 风险很大,因为这是一个大项目。 我可以用来解决这个问题的另一种选择是什么? 谢谢

git gitlab git-branch git-push
© www.soinside.com 2019 - 2024. All rights reserved.