Skip to content

Commit

Permalink
docs branches.md: insert definitions for related terms
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyagr committed Jan 24, 2024
1 parent 99273c0 commit ac2222e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/branches.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,27 @@ some remote.
If you want to know the internals of branch tracking, consult the
[Design Doc][design].

### Terminology summary

- A **remote branch** is a branch ref on the remote. `jj` can find out its
actual state only when it's actively communicating with the remote. However,
`jj` does store the last-seen position of the remote branch; this is the
commit `jj show <branch name>@<remote name>` would show. This notion is
completely analogous to Git's "remote-tracking branches".
- A **tracked (remote) branch** is defined above. You can make a remote branch
tracked with the [`jj branch track` command](#manually-tracking-a-branch), for
example.
- A **tracking (local) branch** is the local branch that `jj` tries to keep in
sync with the tracked remote branch. For example, after `jj branch track
mybranch@origin`, there will be a local branch `mybranch` that's tracking the
remote `mybranch@origin` branch. A local branch can track a branch of the same
name on 0 or more remotes.

The notion of tracked branches serves a similar function to the Git notion of an
"upstream branch". Unlike Git, a single local branch can be tracking remote
branches on multiple remotes, and the names of the local and remote branches
must match.

### Manually tracking a branch

To track a branch permanently use `jj branch track <branch name>@<remote name>`.
Expand Down
8 changes: 8 additions & 0 deletions docs/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ A tree object represents a snapshot of a directory in the repository. Tree
objects are defined recursively; each tree object only has the files and
directories contained directly in the directory it represents.

## Tracked branches and tracking branches

A remote branch can be made "tracked" with the `jj branch track` command. This
results in a "tracking" local branch that tracks the remote branch.

See [the branches documentation](branches.md#terminology-summary) for a more
detailed definition of these terms.

## Visible commits

Visible commits are the commits you see in `jj log -r 'all()'`. They are the
Expand Down

0 comments on commit ac2222e

Please sign in to comment.