在向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这个创建新工程的文件,里面有

def add_project
FileUtils.mkdir_p(full_path, mode: 0770)
#cmd = "cd #{full_path} && git init --bare && #{create_hooks_cmd}"
cmd = "cd #{full_path} && git init --bare"
system(cmd)
end
def create_hooks_cmd
pr_hook_path = File.join(ROOT_PATH, 'hooks', 'post-receive')
up_hook_path = File.join(ROOT_PATH, 'hooks', 'update')
#2013年11月5日 <feixiang> path alway add /home/repositories/ ,but what we want is a absolute path , comment it
"ln -s #{pr_hook_path} #{full_path}/hooks/post-receive && ln -s #{up_hook_path} #{full_path}/hooks/update"
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. iOS中文API之UITouch详解

    UITouch 对象用于位置. 大小. 运动和一根手指在屏幕上为某一特定事件的力度.触摸的力度是从开始在 iOS 9 支持 3D 的触摸的设备上可用.你可以通过UIEvent对象传递给响应者对象访问. ...

  2. js获取GET参数

    自定义函数 /*-----------------实现1--------------------*/ function getPar(par){ //获取当前URL var local_url = d ...

  3. android中RecyclerView控件实现点击事件

    RecyclerView控件实现点击事件跟ListView控件不同,并没有提供类似setOnItemClickListener()这样的注册监听器方法,而是需要自己给子项具体的注册点击事件. 本文的例 ...

  4. ReactNative踩坑日志——使用async/await语法解决网络请求的异步导致的指令执行顺序错乱问题

    转载请注明原文地址: ReactNative的fetch是天然的异步请求,因此,如果你在一个代码块中使用了fetch,那么在执行的时候程序不会等待网络响应结束才执行下一条代码,而是会直接按顺序执行完整 ...

  5. 转:Flash 插件面板 DragonBonesDesignPanel 的绿色安装方法

    最近在cocos2d-js下捣腾Dragonbones.转一个文章,大家可以参考安装Dragonbones.关于这个Dragonbones,5月份的时候还用得好好的,cocos2d-js还能妥妥的加载 ...

  6. XML文件生成C++代码(基于pugixml)

    简述 在一个项目中需要用到XML的解析和生成,知乎上有人推荐rapidxml和pugixml等库.RapidXML一看库还比较大,就先研究一下pugixml了. 因为对解析XML的需求不大(都是一些很 ...

  7. 转 CentOS开启FTP及配置用户

    原文链接: http://www.centos.bz/2011/03/centos-install-vsftpd-ftp-server/ vsftpd作为FTP服务器,在Linux系统中是非常常用的. ...

  8. CentOS 6.4 安装 rabbitmq(3.6.15)

    安装废了一番周折,中间需要装一个socat,网上各种过时的地址. 无奈去socat官网,结果提供编译安装,编译安装完yum install rabbitmq的时候仍然提示缺少需要的依赖,烦,好在折腾两 ...

  9. 转:OGRE场景管理器介绍

    一个场景代表在虚拟世界中显示的物品.场景可以包括静态几何体(比如地形或者室内),模型(比如树.椅子等),光和摄像机.场景有下面种类.室内场景:可能由走廊.有家具的屋子和挂着装饰品的墙组成.室外场景:可 ...

  10. 代理Proxy初探

    Proxy,也就是"代理"了. 意思就是.你不用去做,别人取代你去处理.比方说:租房.你仅仅要找到"我爱我家"中介,把全部的事情交给他们去代劳, "我 ...