myu*_*uf3 10 server git apache2
我最近开始存储代码,我在家里的本地服务器上编写这些代码。
我希望在家里启动一个 gitweb 实例,这样我就可以与其他团队成员一起查看提交并跟踪进度。
我在网上尝试过服务器教程,但没有成功。我希望通过以下方式访问 gitwebexample.com/git
我希望我的代码放在 /code/git
我将不胜感激任何帮助!请尽量直截了当,因为我显然不知道我在做什么。我已经阅读了大量的文章。
谢谢,麻烦您了。
该叫做gitweb部分:
你必须安装包 gitweb sudo apt-get install gitweb
然后你必须编辑 apache gitweb 配置文件
$EDITOR /etc/apache2/conf.d/gitweb
Run Code Online (Sandbox Code Playgroud)
将行更改Alias /gitweb /usr/share/gitweb
为
Alias /git /usr/share/gitweb
Run Code Online (Sandbox Code Playgroud)
打开/etc/gitweb.conf文件:
你要行更改
$projectroot "..",以
$projectroot "/code/git"
并改变含有任何其他线/gitweb到/git
例如
$stylesheet = "/gitweb/gitweb.css";
Run Code Online (Sandbox Code Playgroud)
到
$stylesheet = "/git/gitweb.css";
Run Code Online (Sandbox Code Playgroud)
然后重新加载你的 apache 网络服务器 sudo /etc/init.d/apache2 horse-reload
该GIT部分本身:
我强烈推荐使用 gitosis ( http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way )
记住,如果你使用的gitosis行$projectroot中/etc/gitweb.conf必须是
$projectroot = "/home/git/repositories/";
Run Code Online (Sandbox Code Playgroud)
您可以在http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way找到有关如何设置 gitosis 的详细信息
描述完整的 gitosis 设置对于这个答案来说太长了。
如果您需要有关 gitosis 的更多帮助,请给我留言
要修复 apache 权限问题,可能需要执行以下操作:
adduser www-data git
chgrp -R git /home/git/repositories
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11753 次 |
| 最近记录: |