2021-09-09 17:56:22 +00:00
|
|
|
# Tutorial
|
|
|
|
|
2024-11-15 15:06:41 +00:00
|
|
|
> **Hint:** This tutorial has become somewhat out of date. Many people find
|
|
|
|
> the alternative (not quite finished) [tutorial by Steve
|
|
|
|
> Klabnik](https://steveklabnik.github.io/jujutsu-tutorial/) helpful.
|
2024-08-05 00:22:54 +00:00
|
|
|
|
2021-09-09 17:56:22 +00:00
|
|
|
This text assumes that the reader is familiar with Git.
|
|
|
|
|
2021-10-14 03:33:17 +00:00
|
|
|
## Preparation
|
2021-09-09 17:56:22 +00:00
|
|
|
|
2021-10-14 03:33:17 +00:00
|
|
|
If you haven't already, make sure you
|
2023-08-13 07:31:20 +00:00
|
|
|
[install and configure Jujutsu](install-and-setup.md).
|
2021-09-09 17:56:22 +00:00
|
|
|
|
2024-11-15 15:06:41 +00:00
|
|
|
## Cloning a Git repository
|
|
|
|
|
|
|
|
> **Hint:** Most identifiers used in this tutorial will be different when you
|
|
|
|
> try this at home!
|
2021-09-09 17:56:22 +00:00
|
|
|
|
2023-02-12 22:37:50 +00:00
|
|
|
Let's start by cloning GitHub's Hello-World repo using `jj`:
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2023-08-13 01:38:57 +00:00
|
|
|
```shell
|
2021-09-09 17:56:22 +00:00
|
|
|
# Note the "git" before "clone" (there is no support for cloning native jj
|
|
|
|
# repos yet)
|
2023-02-12 22:37:50 +00:00
|
|
|
$ jj git clone https://github.com/octocat/Hello-World
|
|
|
|
Fetching into new repo in "/tmp/tmp.O1DWMiaKd4/Hello-World"
|
2024-11-15 15:06:41 +00:00
|
|
|
bookmark: master@origin [new] untracked
|
|
|
|
bookmark: octocat-patch-1@origin [new] untracked
|
|
|
|
bookmark: test@origin [new] untracked
|
|
|
|
Setting the revset alias "trunk()" to "master@origin"
|
2024-01-08 10:16:21 +00:00
|
|
|
Working copy now at: kntqzsqt d7439b06 (empty) (no description set)
|
|
|
|
Parent commit : orrkosyo 7fd1a60b master | (empty) Merge pull request #6 from Spaceghost/patch-1
|
2023-02-12 22:37:50 +00:00
|
|
|
Added 1 files, modified 0 files, removed 0 files
|
|
|
|
$ cd Hello-World
|
2021-09-09 17:56:22 +00:00
|
|
|
```
|
|
|
|
|
2024-01-08 10:16:21 +00:00
|
|
|
Running `jj st` (short for `jj status`) now yields something like this:
|
|
|
|
|
2023-08-13 01:38:57 +00:00
|
|
|
```shell
|
2021-09-09 17:56:22 +00:00
|
|
|
$ jj st
|
|
|
|
The working copy is clean
|
2024-01-08 10:16:21 +00:00
|
|
|
Working copy : kntqzsqt d7439b06 (empty) (no description set)
|
|
|
|
Parent commit: orrkosyo 7fd1a60b master | (empty) Merge pull request #6 from Spaceghost/patch-1
|
2021-09-09 17:56:22 +00:00
|
|
|
```
|
|
|
|
|
2024-11-15 15:06:41 +00:00
|
|
|
Let's look at that output as it introduces new concepts. You can see two
|
|
|
|
commits: Parent and working copy. Both are identified using two separate
|
|
|
|
identifiers: the "change ID" and the "commit ID".
|
|
|
|
|
|
|
|
The parent commit, for example, has the change ID `orrkosyo` and the commit ID
|
|
|
|
`7fd1a60b`.
|
|
|
|
|
|
|
|
> **Git users:** The commit ID/hash is what you're used to from Git and should
|
|
|
|
> match what you see when you look at the repository using `git log` in a Git
|
|
|
|
> checkout of the repository.
|
|
|
|
> The change ID however, is a new concept, unique to Jujutsu.
|
|
|
|
|
|
|
|
We can also see from the output above that our working copy is an actual commit
|
|
|
|
with a commit ID (`d7439b06` in the example). When you make a change in the
|
|
|
|
working copy, the working-copy commit gets automatically amended by the next
|
|
|
|
`jj` command.
|
|
|
|
|
|
|
|
> **Git users:** This is a huge difference from Git where the working copy is a
|
|
|
|
> separate concept and not yet a commit.
|
|
|
|
|
|
|
|
## Changes
|
|
|
|
|
|
|
|
A change is a commit that can evolve while keeping a stable identifier (similar
|
|
|
|
to Gerrit's Change-Id). In other words: You can make changes to files in a
|
|
|
|
change, resulting in a new commit hash, but the change ID will remain the same.
|
|
|
|
|
|
|
|
You can see that our clone operation automatically created a new change:
|
|
|
|
|
|
|
|
```
|
|
|
|
Working copy : kntqzsqt d7439b06 (empty) (no description set)
|
|
|
|
```
|
|
|
|
|
|
|
|
This new change has the ID `kntqzsqt` and it is currently empty (contains no
|
|
|
|
changes compared to the parent) and has no description.
|
2021-09-09 17:56:22 +00:00
|
|
|
|
|
|
|
## Creating our first change
|
|
|
|
|
2024-11-15 15:06:41 +00:00
|
|
|
Let's say we want to edit the `README` file in the repo to say "Goodbye"
|
|
|
|
instead of "Hello". Start by describing the change (adding a commit message) so
|
|
|
|
we don't forget what we're working on:
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2023-08-13 01:38:57 +00:00
|
|
|
```shell
|
2024-11-15 15:06:41 +00:00
|
|
|
# This brings up $EDITOR (or `pico` or `Notepad` by default).
|
|
|
|
# Enter something like "Say goodbye" in the editor and then save the file and close
|
2023-08-10 15:50:25 +00:00
|
|
|
# the editor.
|
2021-09-09 17:56:22 +00:00
|
|
|
$ jj describe
|
2024-01-08 10:16:21 +00:00
|
|
|
Working copy now at: kntqzsqt e427edcf (empty) Say goodbye
|
|
|
|
Parent commit : orrkosyo 7fd1a60b master | (empty) Merge pull request #6 from Spaceghost/patch-1
|
2021-09-09 17:56:22 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Now make the change in the README:
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2023-08-13 01:38:57 +00:00
|
|
|
```shell
|
2021-09-09 17:56:22 +00:00
|
|
|
# Adjust as necessary for compatibility with your flavor of `sed`
|
2023-02-12 22:37:50 +00:00
|
|
|
$ sed -i 's/Hello/Goodbye/' README
|
2021-09-09 17:56:22 +00:00
|
|
|
$ jj st
|
|
|
|
Working copy changes:
|
2023-02-12 22:37:50 +00:00
|
|
|
M README
|
2024-01-08 10:16:21 +00:00
|
|
|
Working copy : kntqzsqt 5d39e19d Say goodbye
|
|
|
|
Parent commit: orrkosyo 7fd1a60b master | (empty) Merge pull request #6 from Spaceghost/patch-1
|
2021-09-09 17:56:22 +00:00
|
|
|
```
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2021-09-09 17:56:22 +00:00
|
|
|
Note that you didn't have to tell Jujutsu to add the change like you would with
|
|
|
|
`git add`. You actually don't even need to tell it when you add new files or
|
2021-12-01 17:51:40 +00:00
|
|
|
remove existing files. To untrack a path, add it to your `.gitignore` and run
|
2024-08-25 12:27:15 +00:00
|
|
|
`jj file untrack <path>`.
|
2021-09-09 17:56:22 +00:00
|
|
|
|
2024-11-15 15:06:41 +00:00
|
|
|
Also note that the commit hash for our current change (`kntqzsqt`) changed from
|
|
|
|
`e427edcf` to `5d39e19d`!
|
|
|
|
|
2021-09-09 17:56:22 +00:00
|
|
|
To see the diff, run `jj diff`:
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2023-08-13 01:38:57 +00:00
|
|
|
```shell
|
2021-10-13 15:31:46 +00:00
|
|
|
$ jj diff --git # Feel free to skip the `--git` flag
|
2023-02-12 22:37:50 +00:00
|
|
|
diff --git a/README b/README
|
|
|
|
index 980a0d5f19...1ce3f81130 100644
|
|
|
|
--- a/README
|
|
|
|
+++ b/README
|
|
|
|
@@ -1,1 +1,1 @@
|
|
|
|
-Hello World!
|
|
|
|
+Goodbye World!
|
2021-09-09 17:56:22 +00:00
|
|
|
```
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2021-10-13 15:31:46 +00:00
|
|
|
Jujutsu's diff format currently defaults to inline coloring of the diff (like
|
2023-02-12 22:37:50 +00:00
|
|
|
`git diff --color-words`), so we used `--git` above to make the diff readable in
|
2022-12-10 00:55:56 +00:00
|
|
|
this tutorial.
|
2021-09-09 17:56:22 +00:00
|
|
|
|
2022-08-25 23:34:18 +00:00
|
|
|
As you may have noticed, the working-copy commit's ID changed both when we
|
2021-09-09 17:56:22 +00:00
|
|
|
edited the description and when we edited the README. However, the parent commit
|
2022-08-25 23:34:18 +00:00
|
|
|
stayed the same. Each change to the working-copy commit amends the previous
|
2022-08-25 22:18:14 +00:00
|
|
|
version. So how do we tell Jujutsu that we are done amending the current change
|
|
|
|
and want to start working on a new one? That is what `jj new` is for. That will
|
|
|
|
create a new commit on top of your current working-copy commit. The new commit
|
2024-01-17 22:41:43 +00:00
|
|
|
is for the working-copy changes.
|
2022-08-25 22:18:14 +00:00
|
|
|
|
|
|
|
So, let's say we're now done with this change, so we create a new change:
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2023-08-13 01:38:57 +00:00
|
|
|
```shell
|
2022-08-25 22:18:14 +00:00
|
|
|
$ jj new
|
2024-01-08 10:16:21 +00:00
|
|
|
Working copy now at: mpqrykyp aef4df99 (empty) (no description set)
|
|
|
|
Parent commit : kntqzsqt 5d39e19d Say goodbye
|
2021-09-09 17:56:22 +00:00
|
|
|
$ jj st
|
|
|
|
The working copy is clean
|
2024-01-08 10:16:21 +00:00
|
|
|
Working copy : mpqrykyp aef4df99 (empty) (no description set)
|
|
|
|
Parent commit: kntqzsqt 5d39e19d Say goodbye
|
2021-09-09 17:56:22 +00:00
|
|
|
```
|
|
|
|
|
2024-11-15 15:06:41 +00:00
|
|
|
If we later realize that we want to make further changes, we can make them in
|
|
|
|
the working copy and then run `jj squash`. That command squashes (moves) the
|
|
|
|
changes from a given commit into its parent commit. Like most commands, it acts
|
|
|
|
on the working-copy commit by default. When run on the working-copy commit, it
|
|
|
|
behaves very similar to `git commit --amend`, and `jj amend` is in fact an alias
|
|
|
|
for `jj squash`.
|
2023-02-12 22:37:50 +00:00
|
|
|
|
|
|
|
Alternatively, we can use `jj edit <commit>` to resume editing a commit in the
|
|
|
|
working copy. Any further changes in the working copy will then amend the
|
2024-01-17 22:41:43 +00:00
|
|
|
commit. Whether you choose to create a new change and squash, or to edit,
|
|
|
|
typically depends on how done you are with the change; if the change is almost
|
|
|
|
done, it makes sense to use `jj new` so you can easily review your adjustments
|
2024-07-16 17:30:40 +00:00
|
|
|
with `jj diff` before running `jj squash`.
|
2021-09-09 17:56:22 +00:00
|
|
|
|
2024-07-24 13:49:18 +00:00
|
|
|
To view how a change has evolved over time, we can use `jj evolog` to see each
|
2024-11-15 15:06:41 +00:00
|
|
|
recorded change for the current commit. This records changes to the working
|
|
|
|
copy, message, squashes, rebases, etc.
|
2024-04-29 05:49:45 +00:00
|
|
|
|
2023-01-26 23:02:19 +00:00
|
|
|
## The log command and "revsets"
|
2021-09-09 17:56:22 +00:00
|
|
|
|
|
|
|
You're probably familiar with `git log`. Jujutsu has very similar functionality
|
2022-05-14 15:55:46 +00:00
|
|
|
in its `jj log` command:
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2023-08-13 01:38:57 +00:00
|
|
|
```shell
|
2022-05-14 15:55:46 +00:00
|
|
|
$ jj log
|
2024-01-08 10:16:21 +00:00
|
|
|
@ mpqrykyp martinvonz@google.com 2023-02-12 15:00:22.000 -08:00 aef4df99
|
2023-02-12 22:37:50 +00:00
|
|
|
│ (empty) (no description set)
|
2024-01-08 10:16:21 +00:00
|
|
|
◉ kntqzsqt martinvonz@google.com 2023-02-12 14:56:59.000 -08:00 5d39e19d
|
2023-02-12 22:37:50 +00:00
|
|
|
│ Say goodbye
|
2024-01-08 10:16:21 +00:00
|
|
|
│ ◉ tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 octocat-patch-1@origin b1b3f972
|
|
|
|
├─╯ sentence case
|
|
|
|
│ ◉ kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test@origin b3cbd5bb
|
|
|
|
├─╯ Create CONTRIBUTING.md
|
|
|
|
◉ orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b
|
2023-02-12 22:37:50 +00:00
|
|
|
│ (empty) Merge pull request #6 from Spaceghost/patch-1
|
|
|
|
~
|
2021-09-09 17:56:22 +00:00
|
|
|
```
|
|
|
|
|
2023-02-12 22:37:50 +00:00
|
|
|
The `@` indicates the working-copy commit. The first ID on a line
|
2024-11-15 15:06:41 +00:00
|
|
|
(e.g. "mpqrykyp" above) is the change ID. The second ID is the commit ID. You
|
|
|
|
can give either ID to commands that take revisions as arguments. We will
|
|
|
|
generally prefer change IDs because they stay the same when the commit is
|
|
|
|
rewritten.
|
2022-05-14 15:55:46 +00:00
|
|
|
|
2022-12-10 00:55:56 +00:00
|
|
|
By default, `jj log` lists your local commits, with some remote commits added
|
2024-11-15 15:06:41 +00:00
|
|
|
for context. The `~` indicates that the commit has parents that are not included
|
|
|
|
in the graph. We can use the `--revisions`/`-r` flag to select a different set
|
|
|
|
of revisions to list. The flag accepts a ["revset"](revsets.md), which is an
|
|
|
|
expression in a simple language for specifying revisions. For example, `@`
|
|
|
|
refers to the working-copy commit, `root()` refers to the root commit,
|
|
|
|
`bookmarks()` refers to all commits pointed to by bookmarks (similar to Git's
|
|
|
|
branches). We can combine expressions with `|` for union, `&` for intersection
|
|
|
|
and `~` for difference. For example:
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2023-08-13 01:38:57 +00:00
|
|
|
```shell
|
2024-09-11 16:11:50 +00:00
|
|
|
$ jj log -r '@ | root() | bookmarks()'
|
2024-01-08 10:16:21 +00:00
|
|
|
@ mpqrykyp martinvonz@google.com 2023-02-12 15:00:22.000 -08:00 aef4df99
|
2023-02-12 22:37:50 +00:00
|
|
|
╷ (empty) (no description set)
|
2024-01-08 10:16:21 +00:00
|
|
|
◉ orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b
|
2023-02-12 22:37:50 +00:00
|
|
|
╷ (empty) Merge pull request #6 from Spaceghost/patch-1
|
2024-01-08 10:16:21 +00:00
|
|
|
◉ zzzzzzzz root() 00000000
|
2021-09-09 17:56:22 +00:00
|
|
|
```
|
|
|
|
|
2024-11-15 15:06:41 +00:00
|
|
|
The `00000000` commit (change ID `zzzzzzzz`) is a virtual commit that's called
|
|
|
|
the "root commit". It's the root commit of every repo. The `root()`
|
2023-09-03 03:47:23 +00:00
|
|
|
function in the revset matches it.
|
2021-09-09 17:56:22 +00:00
|
|
|
|
2021-12-13 06:40:16 +00:00
|
|
|
There are also operators for getting the parents (`foo-`), children (`foo+`),
|
2023-09-05 21:58:13 +00:00
|
|
|
ancestors (`::foo`), descendants (`foo::`), DAG range (`foo::bar`, like
|
2023-10-22 15:27:46 +00:00
|
|
|
`git log --ancestry-path`), range (`foo..bar`, same as Git's). See
|
|
|
|
[the revset documentation](revsets.md) for all revset operators and functions.
|
2021-09-09 17:56:22 +00:00
|
|
|
|
2024-08-05 00:22:54 +00:00
|
|
|
> **Hint:** If the default `jj log` omits some commits you expect to see, you
|
|
|
|
> can always run `jj log -r ::` (or, equivalently, `jj log -r 'all()'`) to see
|
|
|
|
> all the commits.
|
|
|
|
|
2021-09-09 17:56:22 +00:00
|
|
|
## Conflicts
|
|
|
|
|
|
|
|
Now let's see how Jujutsu deals with merge conflicts. We'll start by making some
|
2023-10-23 04:51:04 +00:00
|
|
|
commits. We use `jj new` with the `--message`/`-m` option to set change
|
|
|
|
descriptions (commit messages) right away.
|
|
|
|
|
2023-08-13 01:38:57 +00:00
|
|
|
```shell
|
2024-09-11 16:11:50 +00:00
|
|
|
# Start creating a chain of commits off of the `master` bookmark
|
2023-02-12 22:37:50 +00:00
|
|
|
$ jj new master -m A; echo a > file1
|
2024-01-08 10:16:21 +00:00
|
|
|
Working copy now at: nuvyytnq 00a2aeed (empty) A
|
|
|
|
Parent commit : orrkosyo 7fd1a60b master | (empty) Merge pull request #6 from Spaceghost/patch-1
|
2021-10-24 06:51:16 +00:00
|
|
|
Added 0 files, modified 1 files, removed 0 files
|
2022-08-25 22:18:14 +00:00
|
|
|
$ jj new -m B1; echo b1 > file1
|
2024-01-08 10:16:21 +00:00
|
|
|
Working copy now at: ovknlmro 967d9f9f (empty) B1
|
|
|
|
Parent commit : nuvyytnq 5dda2f09 A
|
2022-08-25 22:18:14 +00:00
|
|
|
$ jj new -m B2; echo b2 > file1
|
2024-01-08 10:16:21 +00:00
|
|
|
Working copy now at: puqltutt 8ebeaffa (empty) B2
|
|
|
|
Parent commit : ovknlmro 7d7c6e6b B1
|
2022-08-25 22:18:14 +00:00
|
|
|
$ jj new -m C; echo c > file2
|
2024-01-08 10:16:21 +00:00
|
|
|
Working copy now at: qzvqqupx 62a3c6d3 (empty) C
|
|
|
|
Parent commit : puqltutt daa6ffd5 B2
|
2022-05-26 15:10:31 +00:00
|
|
|
$ jj log
|
2024-01-08 10:16:21 +00:00
|
|
|
@ qzvqqupx martinvonz@google.com 2023-02-12 15:07:41.946 -08:00 2370ddf3
|
2023-02-12 22:37:50 +00:00
|
|
|
│ C
|
2024-01-08 10:16:21 +00:00
|
|
|
◉ puqltutt martinvonz@google.com 2023-02-12 15:07:33.000 -08:00 daa6ffd5
|
2023-02-12 22:37:50 +00:00
|
|
|
│ B2
|
2024-01-08 10:16:21 +00:00
|
|
|
◉ ovknlmro martinvonz@google.com 2023-02-12 15:07:24.000 -08:00 7d7c6e6b
|
2023-02-12 22:37:50 +00:00
|
|
|
│ B1
|
2024-01-08 10:16:21 +00:00
|
|
|
◉ nuvyytnq martinvonz@google.com 2023-02-12 15:07:05.000 -08:00 5dda2f09
|
2023-02-12 22:37:50 +00:00
|
|
|
│ A
|
2024-01-08 10:16:21 +00:00
|
|
|
│ ◉ kntqzsqt martinvonz@google.com 2023-02-12 14:56:59.000 -08:00 5d39e19d
|
2023-02-12 22:37:50 +00:00
|
|
|
├─╯ Say goodbye
|
2024-01-08 10:16:21 +00:00
|
|
|
│ ◉ tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 octocat-patch-1@origin b1b3f972
|
|
|
|
├─╯ sentence case
|
|
|
|
│ ◉ kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test@origin b3cbd5bb
|
|
|
|
├─╯ Create CONTRIBUTING.md
|
|
|
|
◉ orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b
|
2023-02-12 22:37:50 +00:00
|
|
|
│ (empty) Merge pull request #6 from Spaceghost/patch-1
|
|
|
|
~
|
2021-09-09 17:56:22 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
We now have a few commits, where A, B1, and B2 modify the same file, while C
|
2023-10-23 04:51:04 +00:00
|
|
|
modifies a different file. Let's now rebase B2 directly onto A. We use the
|
|
|
|
`--source`/`-s` option on the change ID of B2, and `--destination`/`-d` option
|
|
|
|
on A.
|
|
|
|
|
2023-08-13 01:38:57 +00:00
|
|
|
```shell
|
2024-01-08 10:16:21 +00:00
|
|
|
$ jj rebase -s puqltutt -d nuvyytnq # Replace the IDs by what you have for B2 and A
|
2022-08-25 22:18:14 +00:00
|
|
|
Rebased 2 commits
|
2024-11-15 15:06:41 +00:00
|
|
|
Working copy now at: qzvqqupx 1978b534 (conflict) C
|
|
|
|
Parent commit : puqltutt f7fb5943 (conflict) B2
|
|
|
|
Added 0 files, modified 1 files, removed 0 files
|
|
|
|
There are unresolved conflicts at these paths:
|
|
|
|
file1 2-sided conflict
|
2024-01-08 10:16:21 +00:00
|
|
|
New conflicts appeared in these commits:
|
|
|
|
qzvqqupx 1978b534 (conflict) C
|
|
|
|
puqltutt f7fb5943 (conflict) B2
|
|
|
|
To resolve the conflicts, start by updating to the first one:
|
|
|
|
jj new puqltuttzvly
|
|
|
|
Then use `jj resolve`, or edit the conflict markers in the file directly.
|
2024-07-16 17:30:40 +00:00
|
|
|
Once the conflicts are resolved, you may want to inspect the result with `jj diff`.
|
2024-01-08 10:16:21 +00:00
|
|
|
Then run `jj squash` to move the resolution into the conflicted commit.
|
2024-11-15 15:06:41 +00:00
|
|
|
|
2022-05-26 15:10:31 +00:00
|
|
|
$ jj log
|
2024-01-08 10:16:21 +00:00
|
|
|
@ qzvqqupx martinvonz@google.com 2023-02-12 15:08:33.000 -08:00 1978b534 conflict
|
2023-02-12 22:37:50 +00:00
|
|
|
│ C
|
2024-01-08 10:16:21 +00:00
|
|
|
◉ puqltutt martinvonz@google.com 2023-02-12 15:08:33.000 -08:00 f7fb5943 conflict
|
2023-02-12 22:37:50 +00:00
|
|
|
│ B2
|
2024-01-08 10:16:21 +00:00
|
|
|
│ ◉ ovknlmro martinvonz@google.com 2023-02-12 15:07:24.000 -08:00 7d7c6e6b
|
2023-02-12 22:37:50 +00:00
|
|
|
├─╯ B1
|
2024-01-08 10:16:21 +00:00
|
|
|
◉ nuvyytnq martinvonz@google.com 2023-02-12 15:07:05.000 -08:00 5dda2f09
|
2023-02-12 22:37:50 +00:00
|
|
|
│ A
|
2024-01-08 10:16:21 +00:00
|
|
|
│ ◉ kntqzsqt martinvonz@google.com 2023-02-12 14:56:59.000 -08:00 5d39e19d
|
2023-02-12 22:37:50 +00:00
|
|
|
├─╯ Say goodbye
|
2024-01-08 10:16:21 +00:00
|
|
|
│ ◉ tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 octocat-patch-1@origin b1b3f972
|
|
|
|
├─╯ sentence case
|
|
|
|
│ ◉ kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test@origin b3cbd5bb
|
|
|
|
├─╯ Create CONTRIBUTING.md
|
|
|
|
◉ orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b
|
2023-02-12 22:37:50 +00:00
|
|
|
│ (empty) Merge pull request #6 from Spaceghost/patch-1
|
|
|
|
~
|
2021-09-09 17:56:22 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
There are several things worth noting here. First, the `jj rebase` command said
|
2022-08-25 22:18:14 +00:00
|
|
|
"Rebased 2 commits". That's because we asked it to rebase commit B2 with the
|
|
|
|
`-s` option, which also rebases descendants (commit C in this case). Second,
|
2024-11-15 15:06:41 +00:00
|
|
|
because B2 modified the same file (and word) as B1, rebasing it resulted in
|
|
|
|
conflicts, as the output indicates. Third, the conflicts did not prevent the
|
|
|
|
rebase from completing successfully, nor did it prevent C from getting rebased
|
|
|
|
on top.
|
2021-09-09 17:56:22 +00:00
|
|
|
|
2022-08-25 22:18:14 +00:00
|
|
|
Now let's resolve the conflict in B2. We'll do that by creating a new commit on
|
|
|
|
top of B2. Once we've resolved the conflict, we'll squash the conflict
|
|
|
|
resolution into the conflicted B2. That might look like this:
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2023-08-13 01:38:57 +00:00
|
|
|
```shell
|
2024-01-08 10:16:21 +00:00
|
|
|
$ jj new puqltutt # Replace the ID by what you have for B2
|
|
|
|
Working copy now at: zxoosnnp c7068d1c (conflict) (empty) (no description set)
|
|
|
|
Parent commit : puqltutt f7fb5943 (conflict) B2
|
2023-02-12 22:37:50 +00:00
|
|
|
Added 0 files, modified 0 files, removed 1 files
|
2024-11-15 15:06:41 +00:00
|
|
|
There are unresolved conflicts at these paths:
|
|
|
|
file1 2-sided conflict
|
|
|
|
|
2021-11-06 23:17:51 +00:00
|
|
|
$ jj st
|
|
|
|
The working copy is clean
|
|
|
|
There are unresolved conflicts at these paths:
|
2023-02-12 22:37:50 +00:00
|
|
|
file1 2-sided conflict
|
2024-01-08 10:16:21 +00:00
|
|
|
Working copy : zxoosnnp c7068d1c (conflict) (empty) (no description set)
|
|
|
|
Parent commit: puqltutt f7fb5943 (conflict) B2
|
2024-11-15 15:06:41 +00:00
|
|
|
To resolve the conflicts, start by updating to it:
|
|
|
|
jj new puqltutt
|
|
|
|
Then use `jj resolve`, or edit the conflict markers in the file directly.
|
|
|
|
Once the conflicts are resolved, you may want to inspect the result with `jj diff`.
|
|
|
|
Then run `jj squash` to move the resolution into the conflicted commit.
|
|
|
|
|
2021-09-09 17:56:22 +00:00
|
|
|
$ cat file1
|
2024-11-15 15:06:41 +00:00
|
|
|
<<<<<<< Conflict 1 of 1
|
|
|
|
%%%%%%% Changes from base to side #1
|
|
|
|
-b1+a+++++++ Contents of side #2
|
|
|
|
b2>>>>>>> Conflict 1 of 1 ends
|
|
|
|
|
2021-09-09 17:56:22 +00:00
|
|
|
$ echo resolved > file1
|
2024-11-15 15:06:41 +00:00
|
|
|
|
|
|
|
$ jj st
|
|
|
|
Working copy changes:
|
|
|
|
M file1
|
|
|
|
Working copy : zxoosnnp c2a31a06 (no description set)
|
|
|
|
Parent commit: puqltutt f7fb5943 (conflict) B2
|
|
|
|
Conflict in parent commit has been resolved in working copy
|
|
|
|
|
2021-09-09 17:56:22 +00:00
|
|
|
$ jj squash
|
|
|
|
Rebased 1 descendant commits
|
2024-11-15 15:06:41 +00:00
|
|
|
Working copy now at: ntxxqymr e3c279cc (empty) (no description set)
|
|
|
|
Parent commit : puqltutt 2c7a658e B2
|
2024-01-08 10:16:21 +00:00
|
|
|
Existing conflicts were resolved or abandoned from these commits:
|
|
|
|
qzvqqupx hidden 1978b534 (conflict) C
|
|
|
|
puqltutt hidden f7fb5943 (conflict) B2
|
2024-11-15 15:06:41 +00:00
|
|
|
|
2022-05-26 15:10:31 +00:00
|
|
|
$ jj log
|
2024-01-08 10:16:21 +00:00
|
|
|
@ ntxxqymr martinvonz@google.com 2023-02-12 19:34:09.000 -08:00 e3c279cc
|
2023-02-12 22:37:50 +00:00
|
|
|
│ (empty) (no description set)
|
2024-01-08 10:16:21 +00:00
|
|
|
│ ◉ qzvqqupx martinvonz@google.com 2023-02-12 19:34:09.000 -08:00 b9da9d28
|
2023-02-12 22:37:50 +00:00
|
|
|
├─╯ C
|
2024-01-08 10:16:21 +00:00
|
|
|
◉ puqltutt martinvonz@google.com 2023-02-12 19:34:09.000 -08:00 2c7a658e
|
2023-02-12 22:37:50 +00:00
|
|
|
│ B2
|
2024-01-08 10:16:21 +00:00
|
|
|
│ ◉ ovknlmro martinvonz@google.com 2023-02-12 15:07:24.000 -08:00 7d7c6e6b
|
2023-02-12 22:37:50 +00:00
|
|
|
├─╯ B1
|
2024-01-08 10:16:21 +00:00
|
|
|
◉ nuvyytnq martinvonz@google.com 2023-02-12 15:07:05.000 -08:00 5dda2f09
|
2023-02-12 22:37:50 +00:00
|
|
|
│ A
|
2024-01-08 10:16:21 +00:00
|
|
|
│ ◉ kntqzsqt martinvonz@google.com 2023-02-12 14:56:59.000 -08:00 5d39e19d
|
2023-02-12 22:37:50 +00:00
|
|
|
├─╯ Say goodbye
|
2024-01-08 10:16:21 +00:00
|
|
|
│ ◉ tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 octocat-patch-1@origin b1b3f972
|
|
|
|
├─╯ sentence case
|
|
|
|
│ ◉ kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test@origin b3cbd5bb
|
|
|
|
├─╯ Create CONTRIBUTING.md
|
|
|
|
◉ orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b
|
2023-02-12 22:37:50 +00:00
|
|
|
│ (empty) Merge pull request #6 from Spaceghost/patch-1
|
|
|
|
~
|
2021-09-09 17:56:22 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Note that commit C automatically got rebased on top of the resolved B2, and that
|
|
|
|
C is also resolved (since it modified only a different file).
|
|
|
|
|
2021-09-20 04:19:47 +00:00
|
|
|
By the way, if we want to get rid of B1 now, we can run `jj abandon
|
2024-01-08 10:16:21 +00:00
|
|
|
ovknlmro`. That will hide the commit from the log output and will rebase any
|
2021-09-20 04:19:47 +00:00
|
|
|
descendants to its parent.
|
2021-09-09 17:56:22 +00:00
|
|
|
|
|
|
|
## The operation log
|
|
|
|
|
|
|
|
Jujutsu keeps a record of all changes you've made to the repo in what's called
|
|
|
|
the "operation log". Use the `jj op` (short for `jj operation`) family of
|
|
|
|
commands to interact with it. To list the operations, use `jj op log`:
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2023-08-13 01:38:57 +00:00
|
|
|
```shell
|
2021-09-09 17:56:22 +00:00
|
|
|
$ jj op log
|
2024-01-08 10:16:21 +00:00
|
|
|
@ d3b77addea49 martinvonz@vonz.svl.corp.google.com 3 minutes ago, lasted 3 milliseconds
|
2023-02-12 22:37:50 +00:00
|
|
|
│ squash commit 63874fe6c4fba405ffc38b0dd926f03b715cf7ef
|
|
|
|
│ args: jj squash
|
2024-01-08 10:16:21 +00:00
|
|
|
◉ 6fc1873c1180 martinvonz@vonz.svl.corp.google.com 3 minutes ago, lasted 1 milliseconds
|
2023-02-12 22:37:50 +00:00
|
|
|
│ snapshot working copy
|
2024-01-08 10:16:21 +00:00
|
|
|
│ args: jj squash
|
|
|
|
◉ ed91f7bcc1fb martinvonz@vonz.svl.corp.google.com 6 minutes ago, lasted 1 milliseconds
|
2023-02-12 22:37:50 +00:00
|
|
|
│ new empty commit
|
2024-01-08 10:16:21 +00:00
|
|
|
│ args: jj new puqltutt
|
|
|
|
◉ 367400773f87 martinvonz@vonz.svl.corp.google.com 12 minutes ago, lasted 3 milliseconds
|
2023-02-12 22:37:50 +00:00
|
|
|
│ rebase commit daa6ffd5a09a8a7d09a65796194e69b7ed0a566d and descendants
|
2024-01-08 10:16:21 +00:00
|
|
|
│ args: jj rebase -s puqltutt -d nuvyytnq
|
2021-09-09 17:56:22 +00:00
|
|
|
[many more lines]
|
|
|
|
```
|
|
|
|
|
2021-11-20 18:30:21 +00:00
|
|
|
The most useful command is `jj undo` (alias for `jj op undo`), which will undo
|
|
|
|
an operation. By default, it will undo the most recent operation. Let's try it:
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2023-08-13 01:38:57 +00:00
|
|
|
```shell
|
2021-11-20 18:30:21 +00:00
|
|
|
$ jj undo
|
2024-01-08 10:16:21 +00:00
|
|
|
New conflicts appeared in these commits:
|
|
|
|
qzvqqupx 1978b534 (conflict) C
|
|
|
|
puqltutt f7fb5943 (conflict) B2
|
|
|
|
To resolve the conflicts, start by updating to the first one:
|
|
|
|
jj new puqltuttzvly
|
|
|
|
Then use `jj resolve`, or edit the conflict markers in the file directly.
|
2024-07-16 17:30:40 +00:00
|
|
|
Once the conflicts are resolved, you may want to inspect the result with `jj diff`.
|
2024-01-08 10:16:21 +00:00
|
|
|
Then run `jj squash` to move the resolution into the conflicted commit.
|
|
|
|
Working copy now at: zxoosnnp 63874fe6 (no description set)
|
|
|
|
Parent commit : puqltutt f7fb5943 (conflict) B2
|
2024-11-15 15:06:41 +00:00
|
|
|
|
2022-05-26 15:10:31 +00:00
|
|
|
$ jj log
|
2024-01-08 10:16:21 +00:00
|
|
|
@ zxoosnnp martinvonz@google.com 2023-02-12 19:34:09.000 -08:00 63874fe6
|
2023-02-12 22:37:50 +00:00
|
|
|
│ (no description set)
|
2024-01-08 10:16:21 +00:00
|
|
|
│ ◉ qzvqqupx martinvonz@google.com 2023-02-12 15:08:33.000 -08:00 1978b534 conflict
|
2023-02-12 22:37:50 +00:00
|
|
|
├─╯ C
|
2024-01-08 10:16:21 +00:00
|
|
|
◉ puqltutt martinvonz@google.com 2023-02-12 15:08:33.000 -08:00 f7fb5943 conflict
|
2023-02-12 22:37:50 +00:00
|
|
|
│ B2
|
2024-01-08 10:16:21 +00:00
|
|
|
│ ◉ ovknlmro martinvonz@google.com 2023-02-12 15:07:24.000 -08:00 7d7c6e6b
|
2023-02-12 22:37:50 +00:00
|
|
|
├─╯ B1
|
2024-01-08 10:16:21 +00:00
|
|
|
◉ nuvyytnq martinvonz@google.com 2023-02-12 15:07:05.000 -08:00 5dda2f09
|
2023-02-12 22:37:50 +00:00
|
|
|
│ A
|
2024-01-08 10:16:21 +00:00
|
|
|
│ ◉ kntqzsqt martinvonz@google.com 2023-02-12 14:56:59.000 -08:00 5d39e19d
|
2023-02-12 22:37:50 +00:00
|
|
|
├─╯ Say goodbye
|
2024-01-08 10:16:21 +00:00
|
|
|
│ ◉ tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 octocat-patch-1@origin b1b3f972
|
|
|
|
├─╯ sentence case
|
|
|
|
│ ◉ kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test@origin b3cbd5bb
|
|
|
|
├─╯ Create CONTRIBUTING.md
|
|
|
|
◉ orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b
|
2023-02-12 22:37:50 +00:00
|
|
|
│ (empty) Merge pull request #6 from Spaceghost/patch-1
|
|
|
|
~
|
2021-09-09 17:56:22 +00:00
|
|
|
```
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2021-09-09 17:56:22 +00:00
|
|
|
As you can perhaps see, that undid the `jj squash` invocation we used for
|
|
|
|
squashing the conflict resolution into commit B2 earlier. Notice that it also
|
|
|
|
updated the working copy.
|
|
|
|
|
|
|
|
You can also view the repo the way it looked after some earlier operation. For
|
2024-11-15 15:06:41 +00:00
|
|
|
example, if you want to see `jj log` output right after the `jj rebase`
|
|
|
|
operation, try `jj log --at-op=367400773f87` but use the hash from your own
|
|
|
|
`jj op log`.
|
2021-09-09 17:56:22 +00:00
|
|
|
|
|
|
|
## Moving content changes between commits
|
|
|
|
|
|
|
|
You have already seen how `jj squash` can combine the changes from two commits
|
|
|
|
into one. There are several other commands for changing the contents of existing
|
2024-01-08 10:16:21 +00:00
|
|
|
commits.
|
2021-09-09 17:56:22 +00:00
|
|
|
|
|
|
|
We'll need some more complex content to test these commands, so let's create a
|
|
|
|
few more commits:
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2023-08-13 01:38:57 +00:00
|
|
|
```shell
|
2023-02-12 22:37:50 +00:00
|
|
|
$ jj new master -m abc; printf 'a\nb\nc\n' > file
|
2024-01-08 10:16:21 +00:00
|
|
|
Working copy now at: ztqrpvnw f94e49cf (empty) abc
|
|
|
|
Parent commit : orrkosyo 7fd1a60b master | (empty) Merge pull request #6 from Spaceghost/patch-1
|
2021-10-24 06:51:16 +00:00
|
|
|
Added 0 files, modified 0 files, removed 1 files
|
2024-11-15 15:06:41 +00:00
|
|
|
|
2022-08-25 22:18:14 +00:00
|
|
|
$ jj new -m ABC; printf 'A\nB\nc\n' > file
|
2024-01-08 10:16:21 +00:00
|
|
|
Working copy now at: kwtuwqnm 6f30cd1f (empty) ABC
|
|
|
|
Parent commit : ztqrpvnw 51002261 ab
|
2024-11-15 15:06:41 +00:00
|
|
|
|
2022-08-25 22:18:14 +00:00
|
|
|
$ jj new -m ABCD; printf 'A\nB\nC\nD\n' > file
|
2024-01-08 10:16:21 +00:00
|
|
|
Working copy now at: mrxqplyk a6749154 (empty) ABCD
|
|
|
|
Parent commit : kwtuwqnm 30aecc08 ABC
|
2024-11-15 15:06:41 +00:00
|
|
|
|
2023-09-05 21:58:13 +00:00
|
|
|
$ jj log -r master::@
|
2024-01-08 10:16:21 +00:00
|
|
|
@ mrxqplyk martinvonz@google.com 2023-02-12 19:38:21.000 -08:00 b98c607b
|
2023-02-12 22:37:50 +00:00
|
|
|
│ ABCD
|
2024-01-08 10:16:21 +00:00
|
|
|
◉ kwtuwqnm martinvonz@google.com 2023-02-12 19:38:12.000 -08:00 30aecc08
|
2023-02-12 22:37:50 +00:00
|
|
|
│ ABC
|
2024-01-08 10:16:21 +00:00
|
|
|
◉ ztqrpvnw martinvonz@google.com 2023-02-12 19:38:03.000 -08:00 51002261
|
2023-02-12 22:37:50 +00:00
|
|
|
│ abc
|
2024-01-08 10:16:21 +00:00
|
|
|
◉ orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b
|
2023-02-12 22:37:50 +00:00
|
|
|
│ (empty) Merge pull request #6 from Spaceghost/patch-1
|
|
|
|
~
|
2021-09-09 17:56:22 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
We "forgot" to capitalize "c" in the second commit when we capitalized the other
|
|
|
|
letters. We then fixed that in the third commit when we also added "D". It would
|
|
|
|
be cleaner to move the capitalization of "c" into the second commit. We can do
|
2024-11-15 15:06:41 +00:00
|
|
|
that by running `jj squash` with the `--interactive`/`-i` option on the third
|
|
|
|
commit. Remember that `jj squash` moves all the changes from one commit into its
|
|
|
|
parent. `jj squash -i` moves only part of the changes into its parent. Now try
|
|
|
|
that:
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2023-08-13 01:38:57 +00:00
|
|
|
```shell
|
2022-08-25 22:18:14 +00:00
|
|
|
$ jj squash -i
|
2024-11-15 15:06:41 +00:00
|
|
|
Hint: Using default editor ':builtin'; run `jj config set --user ui.diff-editor :builtin` to disable this message.
|
|
|
|
Rebased 1 descendant commits
|
2024-01-08 10:16:21 +00:00
|
|
|
Working copy now at: mrxqplyk 52a6c7fd ABCD
|
|
|
|
Parent commit : kwtuwqnm 643061ac ABC
|
2021-09-09 17:56:22 +00:00
|
|
|
```
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2024-05-05 05:24:03 +00:00
|
|
|
That will bring up the built-in diff editor[^alternative_diff_editors] with a
|
|
|
|
diff of the changes in the "ABCD" commit. Expand the file by clicking on `(+)`
|
|
|
|
or with right arrow, then select the sections/line to include by clicking or
|
|
|
|
using space. Once complete, press `c` to confirm changes, or `q` to exit without
|
|
|
|
saving. You can also use the mouse to click on the menu items to see more
|
|
|
|
options (keyboard navigation is currently limited).
|
|
|
|
|
|
|
|
[^alternative_diff_editors]: There are many other diff editors you could use.
|
|
|
|
For example, if you have [Meld](https://meldmerge.org) installed and in the
|
|
|
|
PATH, you can use it via `jj squash -i --tool meld` or a fancier config with `jj
|
|
|
|
squash -i --tool meld-3`. You can configure the default with the
|
|
|
|
[`ui.diff-editor` option](config.md#editing-diffs); those docs also explain how
|
|
|
|
to specify a path to an executable if it is not in the PATH.
|
2024-04-30 00:33:32 +00:00
|
|
|
|
2024-11-15 15:06:41 +00:00
|
|
|
If we look at the diff of the second commit, we now see that all three lines got
|
|
|
|
capitalized:
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2023-08-13 01:38:57 +00:00
|
|
|
```shell
|
2024-11-15 15:06:41 +00:00
|
|
|
$ jj diff -r @- --git
|
|
|
|
diff --git a/file b/file
|
|
|
|
index de980441c3..b1e67221af 100644
|
|
|
|
--- a/file
|
|
|
|
+++ b/file
|
|
|
|
@@ -1,3 +1,3 @@
|
|
|
|
-a
|
|
|
|
-b
|
|
|
|
-c
|
|
|
|
+A
|
|
|
|
+B
|
|
|
|
+C
|
2021-09-09 17:56:22 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
The child change ("ABCD" in our case) will have the same content *state* after
|
|
|
|
the `jj squash` command. That means that you can move any changes you want into
|
|
|
|
the parent change, even if they touch the same word, and it won't cause any
|
|
|
|
conflicts.
|
|
|
|
|
|
|
|
Let's try one final command for changing the contents of an exiting commit. That
|
2024-11-15 15:06:41 +00:00
|
|
|
command is `jj diffedit`, which lets you edit the changes in a commit without
|
2021-09-09 17:56:22 +00:00
|
|
|
checking it out.
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2023-08-13 01:38:57 +00:00
|
|
|
```shell
|
2022-12-18 03:56:21 +00:00
|
|
|
$ jj diffedit -r @-
|
2024-11-15 15:06:41 +00:00
|
|
|
Hint: Using default editor ':builtin'; run `jj config set --user ui.diff-editor :builtin` to disable this message.
|
2024-01-08 10:16:21 +00:00
|
|
|
Created kwtuwqnm 70985eaa (empty) ABC
|
2022-08-25 22:18:14 +00:00
|
|
|
Rebased 1 descendant commits
|
2024-11-15 15:06:41 +00:00
|
|
|
Working copy now at: mrxqplyk 1c72cd50 (conflict) ABCD
|
|
|
|
Parent commit : kwtuwqnm 70985eaa (empty) ABC
|
|
|
|
Added 0 files, modified 1 files, removed 0 files
|
|
|
|
There are unresolved conflicts at these paths:
|
|
|
|
file 2-sided conflict
|
2024-01-08 10:16:21 +00:00
|
|
|
New conflicts appeared in these commits:
|
|
|
|
mrxqplyk 1c72cd50 (conflict) ABCD
|
|
|
|
To resolve the conflicts, start by updating to it:
|
|
|
|
jj new mrxqplykmyqv
|
|
|
|
Then use `jj resolve`, or edit the conflict markers in the file directly.
|
2024-07-16 17:30:40 +00:00
|
|
|
Once the conflicts are resolved, you may want to inspect the result with `jj diff`.
|
2024-01-08 10:16:21 +00:00
|
|
|
Then run `jj squash` to move the resolution into the conflicted commit.
|
2021-09-09 17:56:22 +00:00
|
|
|
```
|
2024-01-08 10:16:21 +00:00
|
|
|
|
2024-11-15 15:06:41 +00:00
|
|
|
In the diff editor, use the arrow keys and spacebar to select all lines but the
|
|
|
|
last. Press 'c' to save the changes and close it. You can now inspect the
|
|
|
|
rewritten commit with `jj diff -r @-` again, and you should see your deletion of
|
|
|
|
the last line. Unlike `jj squash -i`, which left the content state of the commit
|
2023-03-17 05:11:38 +00:00
|
|
|
unchanged, `jj diffedit` (typically) results in a different state, which means
|
|
|
|
that descendant commits may have conflicts.
|
2021-09-09 17:56:22 +00:00
|
|
|
|
2024-11-15 15:06:41 +00:00
|
|
|
Another command for rewriting contents of existing commits is `jj split`. Now
|
|
|
|
that you've seen how `jj squash -i` and `jj diffedit` work, you can hopefully
|
|
|
|
figure out how it works (with the help of the instructions in the diff).
|