LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

hg-root

prints the root directory of the Mercurial repository

TLDR

Show repository root
$ hg root
copy
Use in scripts
$ cd $(hg root)
copy

SYNOPSIS

hg root [options]

DESCRIPTION

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.

PARAMETERS

--share-source

Print the share source root instead, when the repository was created with the share extension.
-T, --template TEMPLATE
Display output with the given template.
--help
Display help information.

CAVEATS

Fails if not in repository. Returns absolute path. Simple utility command.

HISTORY

Root is a Mercurial utility command for locating the repository top-level directory.

SEE ALSO

hg(1), git-rev-parse(1), pwd(1)

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid