Forrest logo
back to the hg tool

hg-root:tldr:46f3f

hg-root: Display the root location of the current repository.
$ hg root
try on your machine

The hg root command is used in Mercurial, a distributed version control system, to display the root directory of the current repository.

When you execute the hg root command within a Mercurial repository, it will output the absolute path of the repository's root directory. This directory is the top-level directory of the repository where the .hg folder, containing the repository's history and metadata, is located.

The hg root command is often used in scripts or automation tools that require the absolute path of the repository's root directory to perform various operations.

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