File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,3 +42,26 @@ jj diff -r changeid2 # Fix bar
4242It should be rare that the prompter has to ` cd ` into the temp worktree to review
4343changes. Mention that only when a command must run from the worktree, or when
4444the prompter must inspect VCS-ignored files.
45+
46+
47+ ## Git-Dependent Scripts In JJ Workspaces
48+
49+ Some scripts may shell out to ` git ` even when the active checkout is a
50+ non-colocated jj workspace without a ` .git ` directory. If a check fails with
51+ ` fatal: not a git repository ` , do not give up immediately. Retry with Git
52+ pointed at the original colocated repository and the current jj workspace as the
53+ work tree:
54+
55+ ``` sh
56+ GIT_DIR=/path/to/original/repo/.git \
57+ GIT_WORK_TREE=" $PWD " \
58+ < command>
59+ ```
60+
61+ If the command runs through a task runner that filters environment variables,
62+ also pass whatever setting is needed for that runner to preserve ` GIT_DIR ` and
63+ ` GIT_WORK_TREE ` . Prefer the runner's own environment-variable override when it
64+ has one, so the workaround can live in the command environment instead of every
65+ runner invocation. For example, Turbo projects can use ` TURBO_ENV_MODE=loose ` .
66+ Other monorepo tooling may have its own workaround when it is sensitive to
67+ environment filtering.
You can’t perform that action at this time.
0 commit comments