jj-git-root
print the path of the backing Git directory
TLDR
SYNOPSIS
jj git root [options]
DESCRIPTION
jj git root prints the path of the underlying Git directory for a repository that uses the Git backend.In a colocated workspace that is the workspace-root `.git` directory. In a non-colocated workspace the Git store is hidden under `.jj` (typically `.jj/repo/store/git`), so Git tools that look for `.git` in the working copy fail unless you set GIT_DIR to this path.A common case is GitHub CLI (`gh`) in a non-colocated repo: `GITDIR=$(jj git root) gh issue list`. **direnv** users can put `export GITDIR=$(jj git root)` in `.envrc` so that happens automatically.This is not the workspace root. For the directory that contains the working copy, use jj workspace root (or jj root).
PARAMETERS
-R, --repository PATH
Operate on the repository at PATH instead of searching upward from the current directory.-h, --help
Display help information.
INSTALL
CAVEATS
Subcommand of jj. Requires the Git backend; it errors on a non-Git repository. The printed path may be a `.git` file (a gitdir pointer) rather than a directory in some layouts.
SEE ALSO
jj-git(1), jj-git-colocation(1), jj(1), git-rev-parse(1)
