Skip to main content

Jujutsu Version Control: Change Basics

·3 mins

When using Jujutsu you spend a lot of time working with changes. A change in a Jujutsu repository involves the following steps:

  1. Create a new change.
  2. Make changes to your project.
  3. Describe the change.

Creating a Change #

Run the jj new command to create a change.

jj new

After creating a change, you can make changes in your project, such as adding, editing, and removing code.

Describing a Change #

Run the jj describe command to describe the change you’re making. The fastest way to describe a change is to use the -m option and enter the description.

jj describe -m "Change description"

If you omit the -m option,

jj describe

A text editor opens for you to describe the change. Using a text editor is a better option for longer descriptions that span multiple paragraphs. The article on setting up Jujutsu has a section on setting the text editor to use for describing changes. The Jujutsu documentation also has instructions on setting the text editor

Ending a Change #

End a change by running the jj new command to create a new change.

Seeing What Changed #

To see what changed in a given change, run the jj show command and supply a change ID. The following command shows what has changed in the working copy:

jj show @

The output from the jj show command looks similar to the following:

Commit ID: 7c99cf278a679aacf6444c5e251fea341fa8f440
Change ID: zxxkyukrxnuskrpvspwxxxtkwuuqltuy
Author   : Mark <mark@example.com> (2025-07-07 19:04:31)
Committer: Mark <mark@example.com> (2025-07-07 19:04:31)

    Use a split view for the repo view. 
    The sidebar has a list of changes. 
    Selecting a change shows its details.

Modified regular file RepoView.swift:
    ...
   9    9: 
  10   10: struct RepoView: View {
  11   11:     @Binding var repo: Repo
       12:     @State private var selection: Change? = nil
  12   13:     
  13   14:     var body: some View {
  14   15:         NavigationSplitView {
  14   16:             ChangeList(repo: $repo)
       16: , selection: $selection)
       17:                 .navigationDestination(item: $selection) { selection in
       18:                     ChangeView(change: $selection.safeBinding(defaultValue: selection))
       19:                 }
  15   20:                 .onAppear {
  16   21:                     repo.loadChanges()
  17   22:                 }
       23:         } detail: {
       24:             Text("Select a change to view its contents.")
  17   25:         }
  18   26:     }
  19   27: }

The start of the output shows the same information the jj log command shows for a change: commit hash, change ID, author, and description.

The remainder of the output lists the files that changed and what changed in each file. You can’t see what changed in the sample output because the text has the same color. The jj show command uses text color to indicate what changed. Additions have green text. Deletions have red text.

Abandoning a Change #

Suppose you make a change, decide your change doesn’t work, and you don’t want to store it in the repo. How do you abandon the change?

Run the jj abandon command. If you don’t supply a change ID,

jj abandon

The working copy’s change is abandoned. To abandon an older change, supply the change ID as the argument to the jj abandon command.

Be careful when abandoning a change because you lose work when abandoning a change. Creating small changes ensures you don’t mistakenly lose a lot of work.