git的一个辅助工具,模拟mercurial的serve命令
gitserve的Python项目详细描述
这是git的一个辅助工具,它模拟了mercurial的serve命令。
它使得通过git自己的gitweb查看所有git项目变得非常容易 运行轻量级本地服务器。
用法
当gitserve正确安装(使用sudo)时,它通常位于 在/usr/local/bin中。请注意,此目录必须位于您的$PATH 由shell找到的环境变量。
使用非常简单:
$ gitserve --help Usage: gitserve [options] <dir> Options: --version show program's version number and exit -h, --help show this help message and exit -v, --verbose print status messages to stdout -q, --quiet don't print anything to stdout -p PORT, --port=PORT port to listen on (default: 8000) -a ADDRESS, --address=ADDRESS address to listen on (default: hostname) -l, --local only listen on 127.0.0.1 -b, --browser open default browser automatically -d, --daemon detach from terminal and become a daemon --pid-file=PIDFILE write the spawned process-id to this file --gitweb=GITWEB use this gitweb cgi file instead of the included version
作为唯一的参数,您可以指定包含git的目录 项目。如果将此参数留空,gitserve将自动使用 当前目录作为gitweb脚本的源。例如:
$ gitserve /home/jannis/git-projects
目录参数中的快捷方式也是可能的,将在 运行时:
$ gitserve ~/git-projects
默认的gitserve进程将监听计算机的主机名和 端口8000,例如:http://127.0.0.1:8000/
如果在启动^{tt1}时提供--port或--address选项$ 你可以让gitserve听你的选择。你必须是根才能跑 它位于端口80或1024以下的任何其他端口。--local选项告诉 gitserve只监听127.0.0.1。
--browser选项告诉gitserve自动启动系统的 启动时具有gitserve服务器URL的默认Web浏览器。
--daemon选项导致整个gitserve进程从 您当前的shell会话,成为后台运行的守护进程。 这在与--pid-file选项结合使用时非常有用 给定文件中的进程ID。
您可以指定gitserve使用的gitweb.cgi文件的位置 使用--gitweb选项(例如/home/jannis/lib/git/gitweb.cgi)。