|
| 1 | +# TAGLINE |
| 2 | + |
| 3 | +manage Git colocation of a Jujutsu workspace |
| 4 | + |
| 5 | +# TLDR |
| 6 | + |
| 7 | +**Show** whether the workspace is colocated with Git |
| 8 | + |
| 9 | +```jj git colocation status``` |
| 10 | + |
| 11 | +**Enable colocation** (move the Git repo to `.git` at the workspace root) |
| 12 | + |
| 13 | +```jj git colocation enable``` |
| 14 | + |
| 15 | +**Disable colocation** (hide the Git repo under `.jj`) |
| 16 | + |
| 17 | +```jj git colocation disable``` |
| 18 | + |
| 19 | +# SYNOPSIS |
| 20 | + |
| 21 | +**jj git colocation** _subcommand_ |
| 22 | + |
| 23 | +# PARAMETERS |
| 24 | + |
| 25 | +**status** |
| 26 | +> Print whether the current workspace is colocated with Git. |
| 27 | +
|
| 28 | +**enable** |
| 29 | +> 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. |
| 30 | +
|
| 31 | +**disable** |
| 32 | +> 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. |
| 33 | +
|
| 34 | +**-h**, **--help** |
| 35 | +> Display help information. |
| 36 | +
|
| 37 | +# DESCRIPTION |
| 38 | + |
| 39 | +**jj git colocation** manages whether a Git-backed Jujutsu workspace is **colocated** with Git. |
| 40 | + |
| 41 | +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. |
| 42 | + |
| 43 | +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. |
| 44 | + |
| 45 | +**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. |
| 46 | + |
| 47 | +# CONFIGURATION |
| 48 | + |
| 49 | +**git.colocate** |
| 50 | +> 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. |
| 51 | +
|
| 52 | +# CAVEATS |
| 53 | + |
| 54 | +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. |
| 55 | + |
| 56 | +# INSTALL |
| 57 | + |
| 58 | +```pacman: sudo pacman -S jujutsu``` |
| 59 | + |
| 60 | +```apk: sudo apk add jujutsu``` |
| 61 | + |
| 62 | +```zypper: sudo zypper install jujutsu``` |
| 63 | + |
| 64 | +```brew: brew install jujutsu``` |
| 65 | + |
| 66 | +```nix: nix profile install nixpkgs#jujutsu``` |
| 67 | + |
| 68 | +<!-- packages: 2026-09-12 --> |
| 69 | + |
| 70 | +# SEE ALSO |
| 71 | + |
| 72 | +[jj-git](/man/jj-git)(1), [jj-git-init](/man/jj-git-init)(1), [jj-git-clone](/man/jj-git-clone)(1), [jj-git-import](/man/jj-git-import)(1), [jj-git-export](/man/jj-git-export)(1), [jj](/man/jj)(1) |
| 73 | + |
| 74 | +# RESOURCES |
| 75 | + |
| 76 | +```[Source code](https://github.com/jj-vcs/jj)``` |
| 77 | + |
| 78 | +```[Homepage](https://jj-vcs.github.io/jj/)``` |
| 79 | + |
| 80 | +```[Documentation](https://docs.jj-vcs.dev/latest/cli-reference/#jj-git-colocation)``` |
| 81 | + |
| 82 | +<!-- verified: 2026-09-13 --> |
0 commit comments