LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

jj-workspace

manages extra working copies attached to a Jujutsu repository

TLDR

List every workspace attached to the repo
$ jj workspace list
copy
Add a workspace at a path (name defaults to the directory basename)
$ jj workspace add [path/to/directory]
copy
Add with an explicit name and parent revision
$ jj workspace add --name [workspace_name] -r [revision] [path/to/directory]
copy
Print the root of the current workspace
$ jj workspace root
copy
Print the root of a named workspace
$ jj workspace root --name [workspace_name]
copy
Rename the current workspace
$ jj workspace rename [new_name]
copy
Stop tracking a workspace without deleting its files
$ jj workspace forget [workspace_name]
copy
Refresh a workspace whose working copy has gone stale
$ jj workspace update-stale
copy

SYNOPSIS

jj workspace (add | forget | list | rename | root | update-stale) [options] [args]

DESCRIPTION

jj workspace attaches extra working copies to one repository. Each workspace is a directory with its own `.jj/` metadata and its own working-copy commit. Extra workspaces show up in `jj log` as `<workspace name>@`. A typical use is a long-running test or build in one checkout while you keep editing in another.`jj workspace add path` creates the directory, links it to the repo, and checks out a new working-copy commit. By default that commit sits on the same parent(s) as the current workspace; -r chooses different parents (including a merge if you pass several). Sparse patterns are copied from the current workspace unless --sparse-patterns says otherwise; each workspace keeps its own sparse set afterwards.`jj workspace forget` only unregisters the workspace. Delete the files yourself, before or after. A working copy becomes stale when another workspace (or an interrupted command) rewrites its commit and the on-disk files are not updated; `jj workspace update-stale` brings them back in sync, creating a recovery commit if the recorded operation was lost.

PARAMETERS

--name NAME

For add: name of the new workspace (default: basename of DESTINATION). For root: workspace to query (default: current).
-r, --revision REVSETS
Parent revision(s) of the new workspace's working-copy commit. Omit to share the current workspace's parent(s). Passing revisions is equivalent to `jj new r1 r2 ...` in the new workspace.
-m, --message MESSAGE
Description for the new working-copy commit (add).
--sparse-patterns copy|full|empty
How the new workspace inherits sparse checkout patterns. Default copy. full materializes every file; empty starts with nothing on disk.
-T, --template TEMPLATE
Render each row of list. Defaults to `templates.workspace_list`.

SUBCOMMANDS

add DESTINATION

Create a new workspace (working copy plus `.jj/` linked to the same repo) at DESTINATION.
forget [WORKSPACES...]
Stop tracking the named workspace's working-copy commit. Disk files are not removed. With no names, forgets the current workspace.
list
Print every workspace and its available root path.
rename NEWNAME_
Rename the current workspace.
root
Print the workspace root directory (`jj root` is a shortcut).
update-stale
Rewrite the working copy so it matches the operation the repo currently records for this 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. Forgetting a workspace does not delete files. Rewriting workspace A's working-copy commit from workspace B leaves A's copy stale until update-stale. Each workspace has independent sparse patterns.

SEE ALSO

jj(1), jj-sparse(1), jj-new(1), jj-log(1), git-worktree(1)

RESOURCES

Copied to clipboard
Kai