当我们有时候回滚了代码,想强制push到远程仓库的时候,

git push origin --force

会报如下错误:

You are not allowed to force push code to a protected branch on this project

如果用的是gitlab版本库,这说明gitlab对仓库启用了保护,需要在仓库中设置一下:

"Settings" -> "Repository" -> scroll down to "Protected branches".

参考链接:在这里

git报错You are not allowed to force push code to a protected branch on this project的更多相关文章

  1. git报错_you are not allowed to push code to protected branches on this project

    问题描述 今天在提交代码的时候,由于使用的是新库,写完代码后,进行push,发现报错 you are not allowed to push code to protected branches on ...

  2. 报错:1130-host ... is not allowed to connect to this MySql server

    报错:1130-host ... is not allowed to connect to this MySql server   解决方法: 1. 改表法. 可能是你的帐号不允许从远程登陆,只能在l ...

  3. Updates were rejected because the remote contains work that you do(git报错解决方案)

    Updates were rejected because the remote contains work that you do(git报错解决方案) 今天向GitHub远程仓库提交本地项目文件时 ...

  4. git报错:'fatal:remote origin already exists

    git报错:'fatal:remote origin already exists'怎么处理?附上git常用操作以及说明.   git添加远程库的时候有可能出现如下的错误, 怎么解决? 只要两步: 1 ...

  5. Git报错 bad numeric config value '100000' for 'pack.windowmemory': out of range

    Git报错 bad numeric config value '10240M' for 'pack.windowmemory': out of range $ git config --edit -- ...

  6. 记Git报错-refusing to merge unrelated histories

    记Git报错-refusing to merge unrelated histories   系统:win7 git版本: 2.16.2.windows.1 问题 1.本地初始化了git仓库,放了一些 ...

  7. linux git 报错提示 fatal: 'origin' does not appear to be a git repository 解决办法

    输入: git pull origin master git报错提示 fatal: 'origin' does not appear to be a git repository fatal: Cou ...

  8. Git fetch和git pull的区别, 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists).

    Git fetch和git pull的区别, 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists). Git fet ...

  9. 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists).

    Git fetch和git pull的区别, 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists). 2017年02 ...

随机推荐

  1. C++程序设计方法1:分离代码

    使用头文件,分离声明与定义 防止重复包含: #ifndef FUNC_H #define FUNC_H .... #endif main函数的命令行参数: #include <iostream& ...

  2. 爬虫——request

    命名规范 module_name,模块 package_name,包 ClassName,类 method_name,方法 ExceptionName,异常 function_name,函数 GLOB ...

  3. PAT-Top1001. Battle Over Cities - Hard Version (35)

    在敌人占领之前由城市和公路构成的图是连通图.在敌人占领某个城市之后所有通往这个城市的公路就会被破坏,接下来可能需要修复一些其他被毁坏的公路使得剩下的城市能够互通.修复的代价越大,意味着这个城市越重要. ...

  4. Java RMI的轻量级实现 - LipeRMI

    Java RMI的轻量级实现 - LipeRMI 之前博主有记录关于Java标准库的RMI,后来发现问题比较多,尤其是在安卓端直接被禁止使用,于是转向了第三方的LipeRMI 注意到LipeRMI的中 ...

  5. JS_高程6.面向对象的程序设计(2)创建对象_1

    一.创建对象的常见方法 (1)Object构造函数创建单个对象,早期的JavaScript开发人员经常使用该模式创建新对象. var person=new Object(); person.name= ...

  6. mui 打开外网链接返回的正姿势!

    我们的返回分两种: 一:按返回按钮只能返回上一页 二:向右滑动一步返回app的面页

  7. Could not load file or assembly 'System.Web.Mvc, Version=5.2.3.0...

    一.在Mvc 发布时出现如下错误: Could not load file or assembly 'System.Web.Mvc, Version=5.2.3.0... 出现错误的原因是 Mvc版本 ...

  8. 弄懂JDK、JRE和JVM到底是什么 关系区别

    首先是JDKJDK(Java Development Kit) 是 Java 语言的软件开发工具包(SDK).在JDK的安装目录下有一个jre目录,里面有两个文件夹bin和lib,在这里可以认为bin ...

  9. [Python设计模式] 第24章 加薪审批——职责链模式

    github地址:https://github.com/cheesezh/python_design_patterns 题目 用程序模拟以下情景 员工向经理发起加薪申请,经理无权决定,需要向总监汇报, ...

  10. 【推荐】Hutool 的通用工具类库

    摘自3.1.1版本作者发布原话,当时看到有点说不上的情绪,为作者的坚持.热爱点个赞. 已经想不起来是怎样结识 Hutool 的,但 Hutool 伴随几个项目的推进,获得了同事一致好评. 没经过实践和 ...