Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Goal

In which you find out that your local Git repository is itself a remote.

Every Repo is a Remote

You've already seen how Jujutsu favors consistency of the model: a minimal bunch of building blocks that compose well together. The same principle applies to remotes.

Git treats the local repository and remotes very differently. Jujutsu offers a simplified model: everything is a remote. You can imagine that your Jujutsu workspace is connected to a collection of remote repositories: your local Git repository is just one of them. Jujutsu doesn't make a big distinction.
Do you have origin hosted on GitHub or Codeberg? In the same way, you have the git remote: it just happens to be hosted locally, on your disk.

Keep this model in mind: it will help you understand why sometimes you'll see branches displayed as my-branch@origin or my-branch@git.

Pseudo-remote

Actually, I lied a bit.

The git repository is more of a pseudo-remote than a true remote. For example, you cannot fetch from and push to it. In fact, for practical purposes, Jujutsu treats the git pseudo-remote in a privileged way: it keeps it updated in real time. You can just imagine that it runs git fetch and git push automatically on every command you run.1

Don't take it too literally: use it as a mental model; it will help reasoning.


  1. For the sake of correctness: instead of fetch and push, Jujutsu dedicates 2 commands for syncing with the git pseudo-remote, jj git import and jj git export. You're unlikely to need them.