LinuxCommandLibrary

jj-git-push

Push jj commits to Git remote

TLDR

Push a bookmark to the given remote (defaults to git.push setting)

$ jj git push [[-b|--bookmark]] [bookmark] --remote [remote]
copy

Push a new bookmark
$ jj git push [[-b|--bookmark]] [bookmark] [[-N|--allow-new]]
copy

Push all tracked bookmarks
$ jj git push --tracked
copy

Push all bookmarks (including new bookmarks)
$ jj git push --all
copy

Push all bookmarks pointing to given revisions
$ jj git push [[-r|--revisions]] [revset]
copy

Push changes/commits by creating new bookmarks (Name format is as per templates.git_push_bookmark setting, defaults to "push-" ++ change_id.short())
$ jj git push [[-c|--change]] [revset]
copy

Push a revision with the given name
$ jj git push --named [name]=[revision]
copy

SYNOPSIS

jj git push [REMOTE...] [--remote ] [--change ] ...

PARAMETERS

--remote, -r
    Remote(s) to push to (repeatable; defaults to primary fetch remote)

--change
    Push specified change ID and descendants

--all-changes
    Push all changes to remote

--branch
    Push specific branch

--all
    Push all branches

-f, --force
    Allow non-fast-forward (force) pushes

--push-opts
    Extra git push options as string

DESCRIPTION

jj git push is a command in Jujutsu (jj), a Git-compatible version control system that emphasizes usability and safety. It pushes Git-compatible references from a jj repository to one or more Git remotes.

Unlike git push, which operates directly on refs, jj git push automatically determines what to push based on the working-copy commit and its ancestors marked as Git commits (via jj git export). This ensures only complete, shareable history is sent, reducing errors in collaborative workflows.

Remotes are configured similarly to Git (in .git/config or jj's config). By default, it pushes to the first remote with a fetch URL matching the repo. Use --remote to specify others. It supports pushing specific changes or branches, and force-pushing with caution.

Ideal for teams mixing Git and jj users, as it generates standard Git refs without manual intervention. Always commit or record changes first, as dirty working copies are ignored.

This command bridges jj's powerful local operations (like automatic rebasing) with Git's network capabilities, making jj a seamless Git frontend.

CAVEATS

Requires Git remotes configured; ignores dirty working copy—commit first. Non-fast-forward pushes need --force and can overwrite history. Only pushes exported Git refs, not jj-internal state.

EXAMPLES

jj git push
jj git push origin
jj git push --change abc123 --remote origin

CONFIG

Set default remote: jj config git.default-remote-push origin

HISTORY

Jujutsu (jj) originated in 2021 from Marten van Kerkwijk and David Orman at Google, with major contributions from Martin Ficke's fork. jj git push added early (v0.1+) to enable Git interoperability, evolving with auto-export features by v0.10+ (2023) for smoother hybrid workflows.

SEE ALSO

git-push(1), jj(1), jj-git-fetch(1), jj-export(1)

Copied to clipboard