LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

jj-git-colocation

manage Git colocation of a Jujutsu workspace

TLDR

Show whether the workspace is colocated with Git
$ jj git colocation status
copy
Enable colocation (move the Git repo to `.git` at the workspace root)
$ jj git colocation enable
copy
Disable colocation (hide the Git repo under `.jj`)
$ jj git colocation disable
copy

SYNOPSIS

jj git colocation subcommand

DESCRIPTION

jj git colocation manages whether a Git-backed Jujutsu workspace is colocated with Git.A colocated workspace is a hybrid Jujutsu/Git workspace: `.jj` and `.git` sit at the same root and share the working copy. This is the default for repositories created with jj git init or jj git clone. In that mode Jujutsu imports and exports Git refs automatically on every jj command, which is convenient when IDEs, `gh`, or other tools expect a `.git` directory.A non-colocated workspace still stores most data in Git format, but the Git repository is hidden under `.jj`. Git tools do not see a `.git` directory at the workspace root, and you must run jj git import / jj git export yourself to keep Git refs in sync.enable automates moving the store from `.jj/repo/store/git` to `.git` and pointing Jujutsu at it. disable reverses that. The command only works on a Git-backed workspace that Jujutsu itself manages; an external Git repo attached with jj git init --git-repo cannot be moved this way.

PARAMETERS

status

Print whether the current workspace is colocated with Git.
enable
Convert into a colocated Jujutsu/Git workspace. Moves the backing Git repository from inside `.jj` to a `.git` directory at the workspace root so Git tools can operate on the same working copy.
disable
Convert into a non-colocated Jujutsu/Git workspace. Moves the `.git` directory at the workspace root into `.jj`. Git commands will no longer work directly in the workspace.
-h, --help
Display help information.

CONFIGURATION

git.colocate

Default colocation for new repos created by jj git init and jj git clone. When false, those commands create a non-colocated workspace unless --colocate is passed.

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. Requires the Git backend. Colocation makes Git tools work, but mixing mutating git and jj commands can produce bookmark conflicts or divergent change IDs (no data loss, but noisy). Automatic import on every command can slow down repos with a very large number of refs; jj util gc helps. Git tools see a non-human-readable representation of conflicted files inside the object store. Colocated workspaces are less resilient if the repo is shared over NFS or Dropbox.

SEE ALSO

RESOURCES

Copied to clipboard
Kai