在向gitlab提交工程的时候,出现错误提示:

remote: GitLab: You are not allowed to access master!
remote: error: hook declined to update refs/heads/master
To sa_gitlab@192.168.xxx:xxx/xxx.git
! [remote rejected] master -> master (hook declined)

这个问题主要是由于git工程里的hooks/post-receive和update引起的。可以删除这两个文件;

但是问题的根源不在这,在新建工程的hooks里面的这两个文件只是ln -s 出来的软链接,关键问题是,这两个软链接链错了位置。

查看 gitlab-shell/lib/gitlab_project.rb这个创建新工程的文件,里面有

  1. def add_project
  2. FileUtils.mkdir_p(full_path, mode: 0770)
  3. #cmd = "cd #{full_path} && git init --bare && #{create_hooks_cmd}"
  4. cmd = "cd #{full_path} && git init --bare"
  5. system(cmd)
  6. end
  7. def create_hooks_cmd
  8. pr_hook_path = File.join(ROOT_PATH, 'hooks', 'post-receive')
  9. up_hook_path = File.join(ROOT_PATH, 'hooks', 'update')
  10. #2013年11月5日 <feixiang> path alway add /home/repositories/ ,but what we want is a absolute path , comment it
  11. "ln -s #{pr_hook_path} #{full_path}/hooks/post-receive && ln -s #{up_hook_path} #{full_path}/hooks/update"
  12. end

把create_hooks_cmd注释了即可,但是,这样在后面如果要在网页修改hooks的话,可能还会出问题...

gitlab hook declined错误的更多相关文章

  1. git push解决办法: ! [remote rejected] master -> master (pre-receive hook declined)

    前天准备上传一个project到GitLab上,但是试了很多次都上传不上去,报错如下: ! [remote rejected] master -> master (pre-receive hoo ...

  2. Git push时报错 ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to......

    今天在使用Git回退到之前某个版本的代码时,进行push时出现如下错误: ! [remote rejected] master -> master (pre-receive hook decli ...

  3. ! [remote rejected] master -> master (pre-receive hook declined)

    前天准备上传一个project到GitLab上,但是试了很多次都上传不上去,报错如下: ! [remote rejected] master -> master (pre-receive hoo ...

  4. git remote: error: hook declined to update

    提交一个项目,push的时候,报错: remote: error: File xxx.rar is MB; this exceeds Git@OSC's file size limit of 100 ...

  5. Git push提示pre-receive hook declined

    master:local auto@ubuntu:~/src/code/ git push Counting objects: 5, done. Delta compression using up ...

  6. hook declined to update refs/heads/dev

    提交一个项目,push的时候,报错: warning: Large files detected. remote: error: File TaodangpuAuction/TaodangpuAuct ...

  7. git:hook declined FATAL: W refs/heads DENIED by fallthru error

    hook declined FATAL: W refs/heads DENIED by fallthru error git提交代码时报错,网上查了,最终结果竟然是测试人员没有给我配置写的权限,配置了 ...

  8. 断电后gitlab报500错误启动出错

    异常断电后,gitlab报500错误,重启无效 通过sudo gitlab-ctl reconfigure启动时, 提示 [execute] pgsql:could not connect to se ...

  9. To ssh://xxx.com:8022/test/project.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'ssh://xxx.com:8022/test/project.git'

    To ssh://xxx.com:8022/test/project.git ! [remote rejected] master -> master (pre-receive hook dec ...

随机推荐

  1. 手机站CSS

    手机web——自适应网页设计(html/css控制) 内核: -ms- /* IE 9 */ -moz- /* Firefox */ -webkit- /* Safari and Chrome */ ...

  2. hadoop mahout 算法和API说明

    org.apache.mahout.cf.taste.hadoop.item.RecommenderJob.main(args) --input 偏好数据路径,文本文件.格式 userid\t ite ...

  3. Win10下安装Ubuntu16.04虚拟机并搭建TensorFlow1.3环境

    本文具体参考资料链接 1.VMware下载安装 百度输入VMware搜索,出现如下界面,点击下载: 此处安装步骤可以网上搜索,也可不用搜索,直接按照按照提示一步一步确认即可完成. 2.Ubuntu16 ...

  4. mysql标准写法及其他常见问题

    /* Navicat MySQL Data Transfer Source Server : localhost_3306 Source Server Version : 50549 Source H ...

  5. 【React Native开发】React Native For Android环境配置以及第一个实例(1)

    年9月15日也公布了ReactNative for Android,尽管Android版本号的项目公布比較迟,可是也没有阻挡了广大开发人员的热情.能够这样讲在2015年移动平台市场上有两个方向技术研究 ...

  6. java HMAC_SHA1加密算法

      java HMAC_SHA1加密算法 CreationTime--2018年7月14日16点46分 Author:Marydon 1.准备工作 import javax.crypto.Mac; i ...

  7. 11、java5线程池之异步任务CompletionService

    JDK文档描述: public interface CompletionService<V> 将生产新的异步任务与使用已完成任务的结果分离开来的服务.生产者 submit 执行的任务.使用 ...

  8. excel 妙用选择性粘贴

    需要注意的是转置功能,是经常会用到的功能.

  9. 完完全全彻底删除VMware_Workstation

    vmware-workstation,卸载不干净.bat脚本自动处理dll.注册的表垃圾 Download https://pan.baidu.com/s/1dmrOs3rkR8cX5b0vTUOxH ...

  10. HOOK 底层键盘消息---WH_KEYBOARD_LL

    代码:屏蔽三个全局快捷键 代码的作用是屏蔽掉凝视中的三个快捷键. LRESULT CALLBACK LowLevelKeyboardProc (INT nCode, WPARAM wParam, LP ...