Skip to content

git worktree: add sync command for git worktrees - #9971

Draft
calebdw wants to merge 1 commit into
calebdw/push-szrsklqtlxzqfrom
calebdw/push-lwqzmqqqoztp
Draft

git worktree: add sync command for git worktrees#9971
calebdw wants to merge 1 commit into
calebdw/push-szrsklqtlxzqfrom
calebdw/push-lwqzmqqqoztp

Conversation

@calebdw

@calebdw calebdw commented Aug 11, 2026

Copy link
Copy Markdown
Member

Add jj git worktree sync command that reconciles jj workspace state
with Git worktree state in colocated repositories. It adopts
externally-created Git worktrees as jj workspaces, forgets workspaces
whose Git worktrees have been removed, and repairs paths for moved
worktrees.

Add git.auto-sync-worktrees config (default: false) to opt into
running this synchronization automatically on every jj invocation.
When disabled (the default), users can run jj git worktree sync
manually or use jj git worktree adopt for individual worktrees.

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added/updated tests to cover my changes
  • I fully understand the code that I am submitting (what it does,
    how it works, how it's organized), including any code drafted by an LLM.
  • For any prose generated by an LLM, I have proof-read and copy-edited with
    an eye towards deleting anything that is irrelevant, clarifying anything
    that is confusing, and adding details that are relevant. This includes,
    for example, commit descriptions, PR descriptions, and code comments.

@calebdw
calebdw requested a review from a team as a code owner August 11, 2026 18:48
@calebdw
calebdw marked this pull request as draft August 11, 2026 18:56
@calebdw
calebdw force-pushed the calebdw/push-lwqzmqqqoztp branch from 031ca0d to 9b32a5f Compare August 11, 2026 18:57
@calebdw
calebdw force-pushed the calebdw/push-lwqzmqqqoztp branch 3 times, most recently from 6af0e6e to bd620e9 Compare August 11, 2026 20:19
@calebdw
calebdw force-pushed the calebdw/push-lwqzmqqqoztp branch from bd620e9 to d96abd7 Compare August 11, 2026 20:36
@calebdw
calebdw marked this pull request as ready for review August 11, 2026 20:37
@calebdw
calebdw force-pushed the calebdw/push-lwqzmqqqoztp branch from d96abd7 to 61b6856 Compare August 12, 2026 19:40
@calebdw
calebdw force-pushed the calebdw/push-lwqzmqqqoztp branch from 61b6856 to 1cff3c2 Compare August 12, 2026 20:00
@yuja

yuja commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

I haven't reviewed the implementation yet, but since this isn't a backend-agnostic command, it seems better to move it under the jj git namespace (e.g. jj git workspace import).

@calebdw
calebdw force-pushed the calebdw/push-lwqzmqqqoztp branch from 1cff3c2 to d662974 Compare August 13, 2026 16:40
@calebdw calebdw changed the title workspaces: sync jj workspaces with external git worktrees git worktree: add sync command for git worktrees Aug 13, 2026
@calebdw
calebdw force-pushed the calebdw/push-lwqzmqqqoztp branch from d662974 to 1025da4 Compare August 13, 2026 16:57
@calebdw
calebdw force-pushed the calebdw/push-lwqzmqqqoztp branch from 1025da4 to 0fd8f30 Compare August 13, 2026 17:19
@calebdw
calebdw force-pushed the calebdw/push-lwqzmqqqoztp branch from 0fd8f30 to a02caca Compare August 13, 2026 17:25
@calebdw
calebdw marked this pull request as draft August 13, 2026 17:46
@calebdw
calebdw force-pushed the calebdw/push-lwqzmqqqoztp branch from a02caca to c958c8d Compare August 13, 2026 17:47
Add `jj git worktree sync` command that reconciles jj workspaces with
git worktrees in colocated repositories:

* Adopts Git worktrees created externally (e.g. via `git worktree
  add`) by creating corresponding jj workspaces.
* Forgets jj workspaces whose Git worktrees have been removed.
* Repairs workspace paths for Git worktrees that have been moved.

Add `git.auto-sync-worktrees` config (default: false) to opt into
running this synchronization automatically on every jj invocation.
When disabled (the default), users can run `jj git worktree sync`
manually or use `jj git worktree adopt` for individual worktrees.
@calebdw
calebdw force-pushed the calebdw/push-lwqzmqqqoztp branch from c958c8d to ee91b44 Compare August 13, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants