← 返回命令列表

Linux command

hg-serve 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start HTTP server

hg serve

Specify port

hg serve -p [8080]

Specify address

hg serve -a [0.0.0.0]

Allow push

hg serve --config web.push_ssl=false --config web.allow_push=*

Run in background

hg serve -d

说明

hg serve starts a built-in HTTP server for the repository. It provides read access via web browser and clone/pull access for other clients. The server is convenient for quick sharing but not for production. It supports multiple repositories with configuration.

参数

-p, --port _PORT_
Listen port (default 8000).
-a, --address _ADDR_
Listen address.
-d, --daemon
Run in background.
--pid-file _FILE_
PID file location.
-n, --name _NAME_
Repository name.
--web-conf _FILE_
Web config file.
--help
Display help information.

FAQ

What is the hg-serve command used for?

hg serve starts a built-in HTTP server for the repository. It provides read access via web browser and clone/pull access for other clients. The server is convenient for quick sharing but not for production. It supports multiple repositories with configuration.

How do I run a basic hg-serve example?

Run `hg serve` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -p, --port _PORT_ do in hg-serve?

Listen port (default 8000).