通过http的私人git仓库 [英] Private git repository over http

查看:153
本文介绍了通过http的私人git仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你可以推荐任何设计一个可以通过http访问的git仓库吗?(有cleutus建议)?我有我自己的http服务器,我想用它来主办一些小型的私人项目。在家里,我可以ssh,但在工作时,防火墙阻止我这样做。



有没有什么免费的方法来建立一个小的私人git存储库,我可以推/取通过http使我可以分享家庭和工作之间的项目?提前致谢!

解决方案

Git支持本机。当然,您需要一个HTTP服务器。



将您的(裸)存储库置于您的web服务器可以访问的文件夹中。在该目录中,运行以下命令:

  $ git --bare update-server-info 
$ mv hooks /post-update.sample钩子/更新后

第一个命令提供了额外的信息,因此web服务器知道如何处理存储库。第二条命令确保在任何时候有人推送到存储库时信息得到更新。



您可以在这里找到这些信息: http://www.kernel.org/pub/software /scm/git/docs/user-manual.html#setting-up-a-public-repository


can you recommend any no-brainer solution for setting up a git repository accessible via http(s, has cleutus suggested)? I have my own http server and I'd like to use it to host some minor private project. At home I can ssh it, but at work firewalls keep me from doing so.

Is there any free way to set up a small private git repository I can push / fetch to via http so that I can share projects between home and work? Thanks in advance!

解决方案

Git supports this natively. You'll need an HTTP server, of course.

Put your (bare) repository in a folder that can be accessed by your web server. In that directory, run the following commands:

$ git --bare update-server-info
$ mv hooks/post-update.sample hooks/post-update

The first command provides extra information so the web server knows what to do with the repository. The second command makes sure that the information gets updated any time someone pushes to the repository.

You can find that information here: http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#setting-up-a-public-repository

这篇关于通过http的私人git仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆