-
Notifications
You must be signed in to change notification settings - Fork 362
Translate 04-git-server gitweb #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
=== GitWeb | ||
|
||
(((serving repositories, GitWeb)))(((GitWeb))) | ||
Now that you have basic read/write and read-only access to your project, you may want to set up a simple web-based visualizer. | ||
Git comes with a CGI script called GitWeb that is sometimes used for this. | ||
如果你对项目有读写权限或只读权限,你可能需要建立起一个基于网页的简易查看器。 | ||
Git 提供了一个叫做 GitWeb 的 CGI 脚本来做这项工作。 | ||
|
||
[[gitweb]] | ||
.The GitWeb web-based user interface. | ||
image::images/git-instaweb.png[The GitWeb web-based user interface.] | ||
.GitWeb 的网页用户界面 | ||
image::images/git-instaweb.png[GitWeb 的网页用户界面] | ||
|
||
If you want to check out what GitWeb would look like for your project, Git comes with a command to fire up a temporary instance if you have a lightweight server on your system like `lighttpd` or `webrick`. | ||
On Linux machines, `lighttpd` is often installed, so you may be able to get it to run by typing `git instaweb` in your project directory. | ||
If you're running a Mac, Leopard comes preinstalled with Ruby, so `webrick` may be your best bet. | ||
To start `instaweb` with a non-lighttpd handler, you can run it with the `--httpd` option.(((git commands, instaweb))) | ||
如果你想要查看 GitWeb 如何展示你的项目,并且在服务器上安装了轻量级网络服务器比如 `lighttpd` 或 `webrick`, Git 提供了一个命令来让你启动一个临时的服务器。 | ||
在 Linux 系统的电脑上,`lighttpd` 通常已经安装了,所以你只需要在项目目录里执行 `git instaweb` 命令即可。 | ||
如果你使用 Mac 系统, Mac OS X Leopard 系统已经预安装了 Ruby,所以 `webrick` 或许是你最好的选择。 | ||
如果不想使用 lighttpd 启动 `instaweb` 命令,你需要在执行时加入 `--httpd` 参数。(((git commands, instaweb))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个option 不是确定用 选项来代替了吗? |
||
|
||
[source,console] | ||
---- | ||
|
@@ -20,19 +20,19 @@ $ git instaweb --httpd=webrick | |
[2009-02-21 10:02:21] INFO ruby 1.8.6 (2008-03-03) [universal-darwin9.0] | ||
---- | ||
|
||
That starts up an HTTPD server on port 1234 and then automatically starts a web browser that opens on that page. | ||
It's pretty easy on your part. | ||
When you're done and want to shut down the server, you can run the same command with the `--stop` option: | ||
这个命令启动了一个监听 1234 端口的 HTTP 服务器,并且自动打开了浏览器。 | ||
这对你来说十分方便。 | ||
当你已经完成了工作并想关闭这个服务器,你可以执行同一个命令,并加上 `--stop` 选项: | ||
|
||
[source,console] | ||
---- | ||
$ git instaweb --httpd=webrick --stop | ||
---- | ||
|
||
If you want to run the web interface on a server all the time for your team or for an open source project you're hosting, you'll need to set up the CGI script to be served by your normal web server. | ||
Some Linux distributions have a `gitweb` package that you may be able to install via `apt` or `yum`, so you may want to try that first. | ||
We'll walk though installing GitWeb manually very quickly. | ||
First, you need to get the Git source code, which GitWeb comes with, and generate the custom CGI script: | ||
如果你现在想为你的团队或你托管的开源项目持续的运行这个页面,你需要通过普通的 Web 服务器来设置 CGI 脚本。 | ||
一些 Linux 发行版的软件库有 `gitweb` 包,可以通过 `apt` 或 `yum` 来安装,你可以先试试。 | ||
接下来我们来快速的了解一下如何手动安装 GitWeb。 | ||
首先,你需要获得 Git 的源代码,它包含了 GitWeb ,并可以生成自定义的 CGI 脚本: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 并可以=》然后 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
[source,console] | ||
---- | ||
|
@@ -47,8 +47,8 @@ make[2]: `GIT-VERSION-FILE' is up to date. | |
$ sudo cp -Rf gitweb /var/www/ | ||
---- | ||
|
||
Notice that you have to tell the command where to find your Git repositories with the `GITWEB_PROJECTROOT` variable. | ||
Now, you need to make Apache use CGI for that script, for which you can add a VirtualHost: | ||
需要注意的是,你需要在命令中指定 `GITWEB_PROJECTROOT` 变量来让程序知道你的 Git 版本库的位置。 | ||
现在,你需要在 Apache 中使用这个 CGI 脚本,你需要为此添加一个虚拟主机: | ||
|
||
[source,console] | ||
---- | ||
|
@@ -66,5 +66,5 @@ Now, you need to make Apache use CGI for that script, for which you can add a Vi | |
</VirtualHost> | ||
---- | ||
|
||
Again, GitWeb can be served with any CGI or Perl capable web server; if you prefer to use something else, it shouldn't be difficult to set up. | ||
At this point, you should be able to visit `http://gitserver/` to view your repositories online. | ||
再次提醒,GitWeb 可以通过任何一个支持 CGI 或 Perl 的网络服务器架设;如果你需要的话,架设起来应该不会很困难。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里指的是使用不同的 HTTP 服务器,不是脚本 |
||
现在,你可以访问 `http://gitserver/` 在线查看你的版本库。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
并且在服务器上安装了轻量级网络服务器比如
lighttpd
或webrick
,Git 提供了一个命令来让你启动一个临时的服务器。=》在服务器上安装了类似于lighttpd
或webrick
的轻量级网络服务器的情况下,Git 允许你运行一个命令来启动一个临时的服务器。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我觉得这里没有必要用“允许”,意思已经能表达出来了