linux – 如何阻止在远程主机上分支
发布时间:2021-02-20 18:12:22 所属栏目:Linux 来源:互联网
导读:有没有办法阻止代码推送直接掌握?我尝试在.git / hooks / update中添加一个脚本: #!/bin/shif [ $USER != git-repo-admin ];then if [ $1 == refs/heads/master ]; then echo Manual pushing to this repo is restricted e
有没有办法阻止代码推送直接掌握?我尝试在.git / hooks / update中添加一个脚本: #!/bin/sh if [ $USER != "git-repo-admin" ]; then if [ "$1" == refs/heads/master ]; then echo "Manual pushing to this repo is restricted" exit 1 fi fi 但这不行 – 每个人都可以推.我只想允许特定用户推送以阻止他人. 解决方法原始脚本是完美的,我只需要将其从.git / hooks / update.sample重命名为远程服务器上的.git / hooks / update,并确保它是可执行的.#!/bin/sh if [ $USER != "git-repo-admin" ]; then if [ "$1" == refs/heads/master ]; then echo "Manual pushing to this repo is restricted" exit 1 fi fi (编辑:台州站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 防止linux线程被调度程序中断
- linux – 在makefile中处理管道及其退出状态的最佳方式
- linux – 我的引导程序无法使用gcc 4.6和4.7 …只编译4.5
- LINUX入门:Ubuntu中使用source报错处理办法
- linux – 不能将基于保险丝的卷暴露给Docker容器
- linux – 无法附加到运行Docker容器的bash
- LINUX实操:VMware数据备份和恢复三种方法
- How to allow/block PING on Linux server – IPTables rul
- LINUX实操:运行Hadoop自带的wordcount单词统计程序
- linux – 如何在内核3.19上加载设备树覆盖
推荐文章
站长推荐
热点阅读