nikivdev/code · error
Specify a bookmark or pass --all
Error message
Specify a bookmark or pass --all
What it means
`flow push` requires you to say what to push. The wrapper refuses to guess: with --all it delegates to `jj git push --all`, otherwise it pushes a single named bookmark. If neither is supplied it throws this error instead of defaulting to pushing everything, which could publish unintended refs.
Source
Thrown at src/jj.rs:257
}
fn run_rebase(opts: JjRebaseOpts) -> Result<()> {
let ctx = current_context()?;
ensure_git_not_busy(&ctx.repo_root)?;
let remote = default_remote(&ctx.repo_root);
let dest = opts.dest.unwrap_or_else(|| default_branch(&ctx.repo_root));
let target = resolve_rebase_target(&ctx.workspace_root, &dest, &remote);
jj_run_in(&ctx.workspace_root, &["rebase", "-d", &target.target])
}
fn run_push(opts: JjPushOpts) -> Result<()> {
let ctx = current_context()?;
ensure_git_not_busy(&ctx.repo_root)?;
if opts.all {
return jj_run_in(&ctx.workspace_root, &["git", "push", "--all"]);
}
let Some(bookmark) = opts.bookmark else {
bail!("Specify a bookmark or pass --all");
};
jj_run_in(
&ctx.workspace_root,
&["git", "push", "--bookmark", &bookmark],
)
}
fn run_sync(opts: JjSyncOpts) -> Result<()> {
let ctx = current_context()?;
ensure_git_not_busy(&ctx.repo_root)?;
let snapshot = collect_status_snapshot(&ctx)?;
let remote = opts
.remote
.unwrap_or_else(|| default_remote(&ctx.repo_root));
let dest = opts.dest.unwrap_or_else(|| default_branch(&ctx.repo_root));
let initial_target = resolve_rebase_target(&ctx.workspace_root, &dest, &remote);
let sync_plan = build_sync_plan(
&snapshot,View on GitHub (pinned to a747e741ae)
Solutions
- Pass the bookmark: `flow push --bookmark <name>` (or positional per CLI usage).
- If you truly want every ref published, run `flow push --all`.
- Run `jj bookmark list` first to find the bookmark you intend to push.
Example fix
// before flow push // after flow push --bookmark main // or flow push --all
Defensive patterns
Strategy: validation
Validate before calling
// shell if [ -z "$BOOKMARK" ] && [ "$ALL" != "1" ]; then echo "need --bookmark <name> or --all" >&2; exit 2; fi
Prevention
- Always pass --bookmark explicitly in scripts.
- Use --all only for publishing every ref deliberately.
- Alias `flow push` to include a default bookmark if your workflow pushes one branch.
When it happens
Trigger: Running `flow push` with neither a bookmark option nor the --all flag, i.e. opts.bookmark is None and opts.all is false in run_push.
Common situations: Typing `flow push` out of habit from git muscle memory (git push defaults to something sensible); forgetting the bookmark name flag; scripting the push without conditional args.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- jj {} failed: {}
- Usage: f hash <paths or unhash args>
- jj {} failed
- jj log failed in {}
- Lin.app is not running
AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01).
Data as JSON: /api/errors/408c9ff81ba30f94.
Report an issue: GitHub.