gitolite push fail solutions

本文介绍了一种在使用Git向远程仓库提交代码时遇到“访问被拒绝”错误的解决方法。通过修改git-daemon配置文件并启用receive-pack参数,成功解决了无法推送代码的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在提交代码中遇到无法提交的问题:

现象:

yuanwei@ubuntu:~/s400_d$ ls

default.xml
yuanwei@ubuntu:~/s400_d$ git push --all

fatal: remote error: access denied or repository not exported: /s400_d.git


 
yuanwei@ubuntu:~/s400_d$ ls
default.xml
yuanwei@ubuntu:~/s400_d$ git remote -v
origin git://192.168.2.132/s400_d.git (fetch)

origin git://192.168.2.132/s400_d.git (push)


解决:

添加一行参数  

 --enable=receive-pack

yuanwei@ubuntu:~/s400_d$ cat /etc/sv/git-daemon/run 
#!/bin/sh
exec 2>&1
echo 'git-daemon starting.'
exec chpst -ugitdaemon:gitolite \
  "$(git --exec-path)"/git-daemon --verbose --reuseaddr \
   --export-all --enable=receive-pack  --base-path=/home/gitolite/repositories  /home/gitolite/repositories



yuanwei@ubuntu:~/s400_d$ git push
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
Everything up-to-date



转载于:https://www.cnblogs.com/yuzaipiaofei/archive/2012/07/15/4124181.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值