In short: it is jj bookmark untrack for
tags. Selection matches jj tag track; refs on the
git remote and refs that aren't tracked are skipped with a warning; each remaining ref's state is
set to untracked in one transaction, recorded as untrack remote tag <symbols>.
The command is cmd_tag_untrack. Its help text: an untracked
remote tag "is just a pointer to the last-fetched remote tag" (source).
1. Command-line surface
| Argument | Type | Default | Meaning |
|---|---|---|---|
TAG[@REMOTE] (positional) | patterns or remote symbols, required | — | Name patterns (globs by default) or exact name@remote symbols, not both (source). |
--remote REMOTE | remote patterns, repeatable | all remotes but git | Which remotes the patterns apply to (source). |
2. Configuration
None. Tags on the reserved git remote can't be untracked
(source, default_ignored_remote_name).
3. End-to-end flow
4. Core architecture touchpoints
| Structure | Read / write | How | Explained on |
|---|---|---|---|
Remote tag RemoteRef.state | write | Set to New (untracked); the target is kept (untrack_remote_tag). | view |
View.local_tags | untouched | The local tag keeps its target. | view |
| Commits | untouched | — | commits |
| Operation | write | One operation if anything was untracked; otherwise Nothing changed. | operations |
5. Transaction and operation
- Transaction: always started; nothing to untrack gives
Nothing changed.(source). - Operation description:
untrack remote tag <name@remote, …>(source). - Commits: none.
jj undoorjj tag trackrestores the tracking.
6. Algorithm and invariants
Selection reuses the tag helpers (source), then each ref is filtered:
git remote refs are refused ("This restriction can be lifted if we want to support untracked @git
tags"), untracked ones are reported, and the rest flip to untracked (source).
A tag deleted locally can still be untracked; its remote entry stays as an untracked remote tag.
Invariants: no target changes, local or remote.
7. Errors and edge cases
| Message | When | Source |
|---|---|---|
Cannot specify both <tag> patterns and <tag>@<remote> symbols / --remote cannot be used with <tag>@<remote> symbols | Mixed or conflicting arguments. | untrack.rs |
Warning: Git-tracking tag cannot be untracked: <symbol> | A ref on the git remote. | untrack.rs |
Warning: Remote tag not tracked yet: <symbol> | Already untracked, or an absent placeholder. | untrack.rs |
| Unmatched-name and unmatched-remote warnings | As for tag track. | mod.rs |
Nothing changed. | Nothing was untracked. | cli_util.rs |
8. Worked example
From upstream's test_tag_track_untrack. After cloning, tag1–tag4
are tracked on origin. The test deletes local tag3, then runs
jj tag untrack 'tag[234]':
Upstream's output (source):
Stopped tracking 3 remote tags.
When the remote later moves all four tags and the test fetches, the output shows
tag: tag2@origin [updated] untracked and the local tag2 stays on commit 1, while tracked
tags follow the remote (source).