在向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的话,可能还会出问题...

最新文章

  1. C# IComparable接口、IComparer接口和CompareTo(Object x)方法、Compare()方法
  2. 在设置app icon时的问题
  3. 获取项目中文件,存放到Debug中。
  4. 【WEB】Tomcat基础使用知识
  5. QSpinBox 和 QSlider 联合使用方法
  6. PL/SQL Developer使用
  7. poj 1934(LCS)
  8. 【CSS sprites (CSS图片精灵) 详解】
  9. Linux下的echo服务器
  10. PHP+mysql统计排名第几位
  11. hdu 5591 ZYB&#39;s Game
  12. MongoDB初探系列之二:认识MongoDB提供的一些经常使用工具
  13. Linux下 Unison 实现文件双向同步
  14. MAC使用超级终端
  15. [WeChall] Training: MySQL I (MySQL, Exploit, Training)
  16. JVM规范系列开篇:为什么要读JVM规范?
  17. Golang入门教程(十一)beego 框架之RESTful Controller 路由
  18. 洛谷P2251 【质量检测】
  19. 要学的javaee技术
  20. [Leetcode 55]跳格子JumpGame

热门文章

  1. Springmvc 服务器端文件下载
  2. Python编程-数据库-利用PyMysql访问windows下的MySql数据库
  3. 我的webrequest经验
  4. WIP 001 - design the applicant screen
  5. C# Chart控件的使用总结1
  6. 开源 JSON 库解析性能对比( Jackson / Json.simple / Gson )
  7. IOS-异常处理
  8. Java之创建对象&gt;4.Enforce noninstantiability with a private constructor
  9. Leetcode 240 Search a 2D Matrix II (二分法和分治法解决有序二维数组查找)
  10. LevelDB和ForestDB简单性能测试(含代码)