From a6a9527ba5b0be20d04a0e7a1f2e74de32ec17e9 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Thu, 25 Aug 2022 17:23:04 -0700 Subject: [PATCH] docs: describe how to use multiple workspaces We have had support for workspaces for six months, but I forgot to update the documentation. This just adds some basic documentation; we can add more later. --- docs/working-copy.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/working-copy.md b/docs/working-copy.md index 2eea2f7bd..1288a89aa 100644 --- a/docs/working-copy.md +++ b/docs/working-copy.md @@ -19,9 +19,6 @@ copy, it will implicitly be untracked. To untrack a file while keeping it in the working copy, first make sure it's [ignored](#ignored-files) and then run `jj untrack `. -Jujutsu currently supports only one working copy -(https://github.com/martinvonz/jj/issues/13). - ## Open/closed revisions @@ -80,3 +77,19 @@ See https://git-scm.com/docs/gitignore for details about the format. `.gitignore` files are supported in any directory in the working copy, as well as in `$HOME/.gitignore`. However, `$GIT_DIR/info/exclude` or equivalent way (maybe `.jj/gitignore`) of specifying per-clone ignores is not yet supported. + + +## Workspaces + +You can have multiple working copies backed by a single repo. Use +`jj workspace add` to create a new working copy. The working copy will have a +`.jj/` directory linked to the main repo. The working copy and the `.jj/` +directory together is called a "workspace". Each workspace can have a different +commit checked out. + +Having multiple workspaces can be useful for running long-running tests in a one +while you continue developing in another, for example. + +When you're done using a workspace, use `jj workspace forget` to make the repo +forget about it. The files can be deleted from disk separately (either before or +after).