git - 您不允许将代码推送到此项目的受保护分支。?
问题描述
当我将代码推送到 gitlab 时,它会出现这种错误,因为我是 git 新手。请指导我!
$ git push origin master Counting objects: 71, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (54/54), done.
Writing objects: 100% (71/71), 9.93 KiB | 0 bytes/s, done.
Total 71 (delta 23), reused 0 (delta 0)
remote: GitLab: You are not allowed to push code to protected branches on this project.To https://gitlab.com/akash/demo.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://gitlab.com/akash/demo.git'
解决方案
受保护的分支就是它听起来的样子。似乎您不是分支的所有者,因为所有者选择让您无法将更改推送到分支中,老实说 - 您对此无能为力。
如果您是所有者并且它以某种方式发生,则可以通过单击存储库中 master 分支旁边的Unprotect按钮轻松修复它。
推荐阅读
- django - 根据 slug 获取属性名称
- firebase - Firebase Cloud Firestore 中有没有办法检查路径是否在数组中
的文件? - java - 将 ObjectifyImpl 转换为 Ofy 可以编译,但在 Eclipse/Java8 中运行时失败
- sass - 是否可以仅在 scss 中编译 mixins?
- python - Efficient way to add many rows to a DataFrame
- html - html位置绝对防止onclick点击
- java - 在 spring-boot 应用程序中解码和分析视频流
- amazon-web-services - 将代码从 GitLab 推送到 AWS EC2 的简单方法
- dart - How to prevent changes in a dropdown in Flutter?
- linux - How existing kernel driver should be initialized as PCI memory-mapped?