← 返回命令列表

Linux command

hg-root 命令

文本

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

常用示例

Show repository root

hg root

Use in scripts

cd $(hg root)

说明

hg root prints the root directory of the Mercurial repository. It outputs the absolute path to the .hg directory's parent. The command is useful in scripts to locate the repository root regardless of current working directory. It fails if not in a repository.

参数

--help
Display help information.

FAQ

What is the hg-root command used for?

hg root prints the root directory of the Mercurial repository. It outputs the absolute path to the .hg directory's parent. The command is useful in scripts to locate the repository root regardless of current working directory. It fails if not in a repository.

How do I run a basic hg-root example?

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

What does --help do in hg-root?

Display help information.