Forrest logo
back to the hg tool

hg-root:tldr:056e3

hg-root: Display the root location of the specified repository.
$ hg root --cwd ${path-to-directory}
try on your machine

The hg root command is used in Mercurial, a distributed version control system, to display the root (or top-level) directory of a Mercurial repository.

In the context of the provided command hg root --cwd ${path-to-directory}, the --cwd option specifies the working directory that Mercurial should consider when running the command. ${path-to-directory} is a placeholder that should be replaced with the actual path to a directory.

So, when you execute this command with a specific directory path, it will display the root directory of the Mercurial repository associated with that directory.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the hg tool