版权申明:未经允许请勿转载。转载前请先联系作者(hello@yeshen.org)

类似文章

之前在自己的电脑上强制提交了不少次。然后刚才发现之前部署的gitlab强制提交不了。

git push -f origin master

报错

Counting objects: 6, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 1.10 KiB | 0 bytes/s, done.
Total 6 (delta 4), reused 0 (delta 0)
remote: GitLab: You are not allowed to force push code to a protected branch on this project.
To yeshen:yeshen/test.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@yeshen:yeshen/test.git'

修改下gitlab的设置就好了。

这里写图片描述

这里写图片描述

PS:
自己是管理员(完全掌控git)就可以这样做
其他情况,还是老老实实merge/rebase吧 :)

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐