简体   繁体   English

Git克隆适用于SSH但不适用于HTTP

[英]Git clone works with SSH but not HTTP

I have a public repo on a server (apache), I can clone it with SSH from local with : 我在服务器(Apache)上有一个公共仓库,我可以使用SSH从本地使用克隆它:

$ git clone user@myserver:public_html/repo

But the same repo can't be cloned with http : 但是同一仓库不能用http克隆:

$ git clone http://myserver/repo 
// fatal: repository 'http://myserver/repo' not found

With a browser I can see the content of my repo when entering (userdir mod is activated and set to be document root) : 使用浏览器,我可以在输入时看到我的回购内容(userdir mod已激活并设置为文档根目录):

http://myserver/repo

and the associated git folder with 和相关的git文件夹

http://myserver/repo/.git

I set the folder permission to 755. 我将文件夹权限设置为755。

What am I doing wrong ? 我究竟做错了什么 ?

Try this: 尝试这个:

git clone https://username@myserver.com/repo/.git

or the insecure version: 或不安全的版本:

git clone https://username:password@myserver.com/repo/.git

Also make sure you are using the latest version of Git. 还要确保您使用的是最新版本的Git。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM