gitlab hook declined错误
2024-08-26 09:06:43
在向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的话,可能还会出问题...
最新文章
- C# IComparable接口、IComparer接口和CompareTo(Object x)方法、Compare()方法
- 在设置app icon时的问题
- 获取项目中文件,存放到Debug中。
- 【WEB】Tomcat基础使用知识
- QSpinBox 和 QSlider 联合使用方法
- PL/SQL Developer使用
- poj 1934(LCS)
- 【CSS sprites (CSS图片精灵) 详解】
- Linux下的echo服务器
- PHP+mysql统计排名第几位
- hdu 5591 ZYB&#39;s Game
- MongoDB初探系列之二:认识MongoDB提供的一些经常使用工具
- Linux下 Unison 实现文件双向同步
- MAC使用超级终端
- [WeChall] Training: MySQL I (MySQL, Exploit, Training)
- JVM规范系列开篇:为什么要读JVM规范?
- Golang入门教程(十一)beego 框架之RESTful Controller 路由
- 洛谷P2251 【质量检测】
- 要学的javaee技术
- [Leetcode 55]跳格子JumpGame
热门文章
- Springmvc 服务器端文件下载
- Python编程-数据库-利用PyMysql访问windows下的MySql数据库
- 我的webrequest经验
- WIP 001 - design the applicant screen
- C# Chart控件的使用总结1
- 开源 JSON 库解析性能对比( Jackson / Json.simple / Gson )
- IOS-异常处理
- Java之创建对象>;4.Enforce noninstantiability with a private constructor
- Leetcode 240 Search a 2D Matrix II (二分法和分治法解决有序二维数组查找)
- LevelDB和ForestDB简单性能测试(含代码)