Git you are not allowed to push code to protected branches on this project?

error: You are not allowed to push code to protected branches on this project.
...
error: failed to push some refs to ...

there‘s no problem - everything works as expected.

In GitLab some branches can be protected. By default only ‘master‘ user can commit to protected branches. master branch is protected by default - it forces developers to issue merge requests to be validated by project master before integrating them into main code.

You can turn on and off protection on selected branches in Project Settings (where exactly depends on GitLab version - see instructions below).

On the same settings page you can also allow developers to push into the protected branches. With this setting on, protection will be limited to rejecting operations requiring git push --force (rebase etc.)

I‘m not really sure when this change was introduced, screenshots are from 10.3 version.

Now you can select who is allowed to merge or push into selected branches (for example: you can turn off pushes to master at all, forcing all changes to branch to be made via Merge Requests). Or you can click "Unprotect" to completely remove protection from branch.

source:

https://stackoverflow.com/questions/32246503/how-to-fix-you-are-not-allowed-to-push-code-to-protected-branches-on-this-proje

原文地址:https://www.cnblogs.com/sdream/p/9480926.html

时间: 2024-10-09 18:20:56

Git you are not allowed to push code to protected branches on this project?的相关文章

git合并分支成功,但是push失败(remote: GitLab: You are not allowed to push code to protected branches on this project.)

紧急修复修改代码之后需要合并分支到master分支并push到线上,但是merge成功,push却失败了,报错如下: ? buzzextractor git:(master) git merge hotfix Updating 4668fce..9527ae9 Fast-forward build_online_images.sh | 2 +- extractor/buzz/lib/utils.py | 2 +- extractor/conf/config.ini.bushu | 2 +- ex

Git 仓库 Push到[email protected]常见错误

将在本地创建的Git仓库push到[email protected]出现的错误 常见错误: 1.error:failed to push some refs to ... 问题(Non-fast-forward)的出现原因在于:git仓库中已经有一部分代码,所以它不允许你直接把你的代码覆盖上去.于是你有2个选择方式: 1.强推,即利用强覆盖方式用你本地的代码替代git仓库内的内容 git push -f 2. 先把git的东西fetch到你本地然后merge后再push $ git fetch

git 命令行 修改文件 并push(阿里云)

==============安装git后的准备https://code.aliyun.com/profile/keyshttps://code.aliyun.com/help/ssh/README ==============首先将源码checkout到本地找到你要放源码的目录,空白处 右键>>Git Bash Here,,然后执行下面命令即可获取源码 git clone [email protected]:youproject.git ==============拿着你最新的源码 覆盖相应的

Git的add、commit、push命令

简单的代码提交流程 git status 查看工作区代码相对于暂存区的差别 git add . 将当前目录下修改的所有代码从工作区添加到暂存区 . 代表当前目录 git commit -m "xxx" 将缓存区内容添加到本地仓库, xxx是对此次修改的描述 git pull --rebase 拉取远程仓库代码并合并(如果有冲突需要进行手动处理)也可以直接使用 git pull 拉取 git pull = git fetch + git merge git pull --rebase =

git的使用,将本地项目push到github上

git是先用add 把代码添加到缓冲区,然后commit提交到本地,等到需要时,再用push到远程服务器文章:http://blog.csdn.net/j_bing/article/details/44754775, http://www.ruanyifeng.com/blog/2014/06/git_remote.html先在GitHub上建立一个代码仓库,第一种方式:在电脑上建立一个文件夹,然后在该文件夹下打开git bash,输入git init:表示把git仓库放在这里,然后git cl

[Git] 还原Git上commit,但是没有push代码

直接在Idea上操作2步解决: 1. 找到: 2. 在To Commit里面填写:HEAD^,表示将commit的信息还原为上一次的,需要多次直接reset多次即可: 使用命令行:原理一样 以下内容转载: http://zhyq0826.iteye.com/blog/1671638 如果不小心commit了一个不需要commit的文件,可以对其进行撤销. 先使用git log 查看 commit日志 commit 422bc088a7d6c5429f1d0760d008d86c505f4abe

Git 的origin和master分析 push/diff/head(转)

1.origin/master : 一个叫 origin 的远程库的 master 分支 2.HEAD指向当前工作的branch,master不一定指向当前工作的branch 3.git  push  origin  本地分支A : 远程分支B ---> push 本地分支A到远程库origin的分支B 首先要明确一点,对git的操作是围绕3个大的步骤来展开的(其实几乎所有的SCM都是这样) 1.     从git取数据(git clone) 2.     改动代码 3.     将改动传回gi

Git设置当前分支为默认push分支

新手刚用Git,Push的时候出现错误: To ssh://*******.com/HRC   e06a5d2..265df95  master -> master ! [rejected]        R8 -> R8 (non-fast-forward) ! [rejected]        reserved -> reserved ([email protected]******.com)error: failed to push some refs to 'ssh://g/H

在Idea中使用git从远程仓库pull和push文件

1 打开idea-> VCS-> import into Version control ->  create git repository 2 在本地目录下建立ignore list 3 写完代码后,右键-> git -> 先add,再commit directory  在Commit changes的中选择commit and push 点击 define romote 输入远程的url地址即可 4 右键-> git->repository-> pull