LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

jj-workspace-root

print the root directory of a Jujutsu workspace

TLDR

Print the current workspace root
$ jj workspace root
copy
Use the path in a script
$ cd "$(jj workspace root)"
copy
Print the root of a named workspace
$ jj workspace root --name [workspace_name]
copy
Avoid snapshotting (common in prompts)
$ jj --ignore-working-copy workspace root
copy

SYNOPSIS

jj workspace root [options]

DESCRIPTION

jj workspace root prints the absolute path of a workspace root: the directory that contains the working copy and the `.jj/` metadata.With no --name, it reports the workspace that contains the current directory. That is the same result as jj root, which is a shortcut for this command without extra flags. --name selects another workspace attached to the same repository.This is the Jujutsu counterpart of `git rev-parse --show-toplevel`. It is not the Git directory; for that path use jj git root.Like other jj commands, jj workspace root snapshots the working copy unless you pass --ignore-working-copy. Shell prompts that only need the path typically use that flag.

PARAMETERS

--name NAME

Workspace to query. Defaults to the current workspace.

INSTALL

sudo pacman -S jujutsu
copy
sudo apk add jujutsu
copy
sudo zypper install jujutsu
copy
brew install jujutsu
copy
nix profile install nixpkgs#jujutsu
copy

CAVEATS

Subcommand of jj. Fails outside a workspace. jj root does not accept --name. Do not confuse with jj git root.

SEE ALSO

RESOURCES

Copied to clipboard
Kai