解决git clone失败的问题
2015-02-04 20:45
483 查看
之前用gitweb搭建了git服务器,在使用 git clone的时候遇到了问题:
然后,重新 clone:
还是有问题。
要解决这个问题,还要修改配置文件 /etc/sv/git-daemon/run
然后, 重启 git deamon:
sudo sv stop git-daemon
sudo sv start git-daemon或者:
sudo sv restart git-daemon
这样,再clone 就没有问题了
$ git clone git://localhost/linux-3.10.28 Cloning into 'linux-3.10.28'... fatal: unable to connect to localhost: localhost[0: 127.0.0.1]: errno=Connection refused经过排查,发现没有安装 git-daemon, 所以接下来安装 git-daemon:
$ sudo aptitude install git-daemon-run
然后,重新 clone:
$ git clone git://localhost/linux-3.10.28 Cloning into 'linux-3.10.28'... fatal: remote error: access denied or repository not exported: /linux-3.10.28
还是有问题。
要解决这个问题,还要修改配置文件 /etc/sv/git-daemon/run
exec 2>&1 echo 'git-daemon starting.' exec chpst -ugitdaemon \ "$(git --exec-path)"/git-daemon --verbose --reuseaddr \ --base-path=/var/lib /var/lib/git修改以后的内容为:
#!/bin/sh exec 2>&1 echo 'git-daemon starting.' #exec chpst -ugitdaemon \ # "$(git --exec-path)"/git-daemon --verbose\ # --base-path=/var/lib /var/lib/git #exec chpst -ugitdaemon "$(git --exec-path)"/git-daemon --verbose\ --export-all --base-path=$HOME/repo --enable=receive-pack下面解释一下几个参数的意义:
--export-all Allow pulling from all directories that look like Git repositories (have the objects and refs subdirectories), even if they do not have the git-daemon-export-ok file.
receive-pack This serves git send-pack clients, allowing anonymous push. It is disabled by default, as there is no authentication in the protocol (in other words, anybody can push anything into the repository, including removal of refs). This is solely meant for a closed LAN setting where everybody is friendly. This service can be enabled by setting daemon.receivepack configuration item to true.
然后, 重启 git deamon:
sudo sv stop git-daemon
sudo sv start git-daemon或者:
sudo sv restart git-daemon
这样,再clone 就没有问题了
相关文章推荐
- git clone 失败问题解决方案
- 解决git clone提示Permission denied publickey 问题
- 解决 git 中【git push origin master】失败的问题
- git clone 过程中 git-pack-objects died问题的解决办法
- (自己测试没有问题)解决git clone时报错:The requested URL returned error: 401 Unauthorized while accessing
- 解决CSDN的code功能,无法git clone多个项目的问题
- 定时任务执行git clone出现permission denied(publickey)问题的解决
- git认证证书问题解决方案(github clone "Permission denied (publickey). fatal: Could not read from remote reposi)
- 解决因文件权限导致git fetch命令执行失败的问题
- DevStack安装问题,git clone noVNC.git失败
- git commit 失败"Untracked files,Changes not staged for commit" 问题的解决
- 【已解决】Ubuntu下git clone 无法连接问题
- 使用Git时,本地仓库向远程仓库push失败问题解决
- [笔记]解决git clone 子模块没下载全的问题
- git clone git://eagain.net/gitosis.git 失败解决方法
- git clone git://eagain.net/gitosis.git 失败解决方法
- 解决git clone 慢问题
- Git clone失败的解决方法