git - 在仅限网络的提供商(无外壳)上发布 Git 存储库

标签 git http

我有一个我想分享的存储库,但不一定要将它放在 github 或其他 Git 托管提供商上。

我的网站托管在提供商 (OVH) 上,该提供商仅提供 ftp 访问权限,不提供 ssh 或 shell。

我的问题是:是否可以只使用 http 来使只读的 git 存储库可用于此提供程序?

如果是,怎么办?然后,如果我想将此存储库克隆回我的桌面,应该发出什么命令?

谢谢!

最佳答案

更新:

另见 Git Book - Setting up a public repository :

All you need to do is place the newly created bare git repository in a directory that is exported by the web server, and make some adjustments to give web clients some extra information they need:

$ mv proj.git /home/you/public_html/proj.git
$ cd proj.git
$ git --bare update-server-info
$ chmod a+x hooks/post-update

Advertise the URL of proj.git. Anybody else should then be able to clone or pull from that URL, for example with a command line like:

$ git clone http://yourserver.com/~you/proj.git

它应该只需创建一个裸 git 存储库并将其放入您的网站空间即可工作。 git 可以处理 http URL。参见 git-clone :

In general, URLs contain information about the transport protocol, the address of the remote server, and the path to the repository. Depending on the transport protocol, some of this information may be absent.

Git natively supports ssh, git, http, https, ftp, ftps, and rsync protocols. The following syntaxes may be used with them:

ssh://[user@]host.xz[:port]/path/to/repo.git/

git://host.xz[:port]/path/to/repo.git/

http[s]://host.xz[:port]/path/to/repo.git/

ftp[s]://host.xz[:port]/path/to/repo.git/

rsync://host.xz/path/to/repo.git/

关于git - 在仅限网络的提供商(无外壳)上发布 Git 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4202726/

相关文章:

php - 如何在 PHP 的 cURL POST HTTP 请求中包含授权 header ?

git - 如何解决 Git 报告无效的 sha1 指针 0000000000000000000000000000000000000000?

git-merge-base 只返回一个提交

php - 检索通过 POST 发送到 PHP 脚本的 json 字段时出错

http - 寻找用于 HTTP 负载共享的消息总线

http - 降级健康检查的 HTTP 状态码应该是什么?

Git:将本地存储库复制到另一个文件夹

Git 推送错误 并非所有引用都已推送

c++ - 在 Visual Studio 2013 中使用 libgit2 C API

java - 如何用java编写http代理?