2021-08-30 06:25:53 +00:00
|
|
|
# Comparison with Git
|
|
|
|
|
2022-03-11 20:58:50 +00:00
|
|
|
## Introduction
|
|
|
|
|
|
|
|
This document attempts to describe how Jujutsu is different from Git. See
|
|
|
|
[the Git-compatibility doc](git-compatibility.md) for information about how
|
|
|
|
the `jj` command interoperates with Git repos.
|
|
|
|
|
|
|
|
|
|
|
|
## Overview
|
|
|
|
|
|
|
|
Here is a list of conceptual differences between Jujutsu and Git, along with
|
|
|
|
links to more details where applicable and available. There's a
|
|
|
|
[table further down](#command-equivalence-table) explaining how to achieve
|
|
|
|
various use cases.
|
|
|
|
|
|
|
|
* **The working copy is automatically committed.** That results in a simpler and
|
|
|
|
more consistent CLI because the working copy is now treated like any other
|
|
|
|
commit. [Details](working-copy.md).
|
2024-01-20 21:44:24 +00:00
|
|
|
* **There's no index (staging area).** Because the working copy is automatically
|
|
|
|
committed, an index-like concept doesn't make sense. The index is very similar
|
|
|
|
to an intermediate commit between `HEAD` and the working copy, so workflows
|
|
|
|
that depend on it can be modeled using proper commits instead. Jujutsu has
|
|
|
|
excellent support for moving changes between commits. [Details](#the-index).
|
2024-01-20 16:21:51 +00:00
|
|
|
* **No need for branch names (but they are supported).** Git lets you check out
|
|
|
|
a commit without attaching a branch. It calls this state "detached HEAD". This
|
|
|
|
is the normal state in Jujutsu (there's actually no way -- yet, at least -- to
|
|
|
|
have an active branch). However, Jujutsu keeps track of all visible heads
|
|
|
|
(leaves) of the commit graph, so the commits won't get lost or
|
|
|
|
garbage-collected.
|
2023-08-03 18:00:42 +00:00
|
|
|
* **No current branch.** Git lets you check out a branch, making it the 'current
|
|
|
|
branch', and new commits will automatically update the branch. This is
|
|
|
|
necessary in Git because Git might otherwise lose track of the new commits.
|
|
|
|
Jujutsu does not have a 'current branch'; instead, you update branches
|
|
|
|
manually. For example, if you check out a commit with a branch, new commits
|
|
|
|
are created on top of the branch, then you issue a later command to update the
|
|
|
|
branch.
|
2022-03-11 20:58:50 +00:00
|
|
|
* **Conflicts can be committed.** No commands fail because of merge conflicts.
|
|
|
|
The conflicts are instead recorded in commits and you can resolve them later.
|
|
|
|
[Details](conflicts.md).
|
|
|
|
* **Descendant commits are automatically rebased.** Whenever you rewrite a
|
|
|
|
commit (e.g. by running `jj rebase`), all its descendants commits will
|
|
|
|
automatically be rebased on top. Branches pointing to it will also get
|
|
|
|
updated, and so will the working copy if it points to any of the rebased
|
|
|
|
commits.
|
|
|
|
* **Branches are identified by their names (across remotes).** For example, if
|
|
|
|
you pull from a remote that has a `main` branch, you'll get a branch by that
|
|
|
|
name in your local repo as well. If you then move it and push back to the
|
|
|
|
remote, the `main` branch on the remote will be updated.
|
|
|
|
[Details](branches.md).
|
|
|
|
* **The operation log replaces reflogs.** The operation log is similar to
|
|
|
|
reflogs, but is much more powerful. It keeps track of atomic updates to all
|
|
|
|
refs at once (Jujutsu thus improves on Git's per-ref history much in the same
|
|
|
|
way that Subversion improved on RCS's per-file history). The operation log
|
|
|
|
powers e.g. the undo functionality. [Details](operation-log.md)
|
|
|
|
* **There's a single, virtual root commit.** Like Mercurial, Jujutsu has a
|
|
|
|
virtual commit (with a hash consisting of only zeros) called the "root commit"
|
|
|
|
(called the "null revision" in Mercurial). This commit is a common ancestor of
|
|
|
|
all commits. That removes the awkward state Git calls the "unborn branch"
|
|
|
|
state (which is the state a newly initialized Git repo is in), and related
|
|
|
|
command-line flags (e.g. `git rebase --root`, `git checkout --orphan`).
|
2021-08-30 06:25:53 +00:00
|
|
|
|
2021-12-18 16:07:17 +00:00
|
|
|
|
|
|
|
## The index
|
|
|
|
|
|
|
|
Git's ["index"](https://git-scm.com/book/en/v2/Git-Tools-Reset-Demystified) has
|
|
|
|
multiple roles. One role is as a cache of file system information. Jujutsu has
|
|
|
|
something similar. Unfortunately, Git exposes the index to the user, which makes
|
|
|
|
the CLI unnecessarily complicated (learning what the different flavors of
|
|
|
|
`git reset` do, especially when combined with commits and/or paths, usually
|
|
|
|
takes a while). Jujutsu, like Mercurial, doesn't make that mistake.
|
|
|
|
|
|
|
|
As a Git power-user, you may think that you need the power of the index to
|
|
|
|
commit only part of the working copy. However, Jujutsu provides commands for
|
|
|
|
more directly achieving most use cases you're used to using Git's index for. For
|
|
|
|
example, to create a commit from part of the changes in the working copy, you
|
|
|
|
might be used to using `git add -p; git commit`. With Jujutsu, you'd instead
|
2022-08-25 23:34:18 +00:00
|
|
|
use `jj split` to split the working-copy commit into two commits. To add more
|
2021-12-18 16:07:17 +00:00
|
|
|
changes into the parent commit, which you might normally use
|
|
|
|
`git add -p; git commit --amend` for, you can instead use `jj squash -i` to
|
2023-08-14 04:35:54 +00:00
|
|
|
choose which changes to move into the parent commit, or `jj squash <file>` to
|
|
|
|
move a specific file.
|
2021-12-18 16:07:17 +00:00
|
|
|
|
|
|
|
|
2021-08-30 06:25:53 +00:00
|
|
|
## Command equivalence table
|
|
|
|
|
2022-08-25 23:34:18 +00:00
|
|
|
Note that all `jj` commands can be run on any commit (not just the working-copy
|
2021-08-30 06:25:53 +00:00
|
|
|
commit), but that's left out of the table to keep it simple. For example,
|
2021-11-10 18:46:10 +00:00
|
|
|
`jj squash/amend -r <revision>` will move the diff from that revision into its
|
|
|
|
parent.
|
2021-08-30 06:25:53 +00:00
|
|
|
|
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Use case</th>
|
|
|
|
<th>Jujutsu command</th>
|
|
|
|
<th>Git command</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>Create a new repo</td>
|
2024-02-25 11:39:42 +00:00
|
|
|
<td><code>jj git init [--colocate]</code></td>
|
2021-08-30 06:25:53 +00:00
|
|
|
<td><code>git init</code></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Clone an existing repo</td>
|
|
|
|
<td><code>jj git clone <source> <destination></code> (there is no support
|
|
|
|
for cloning non-Git repos yet)</td>
|
|
|
|
<td><code>git clone <source> <destination></code></td>
|
|
|
|
</tr>
|
2021-09-12 07:36:54 +00:00
|
|
|
<tr>
|
|
|
|
<td>Update the local repo with all branches from a remote</td>
|
|
|
|
<td><code>jj git fetch [--remote <remote>]</code> (there is no
|
|
|
|
support for fetching into non-Git repos yet)</td>
|
|
|
|
<td><code>git fetch [<remote>]</code></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Update a remote repo with all branches from the local repo</td>
|
2022-07-13 04:14:02 +00:00
|
|
|
<td><code>jj git push --all [--remote <remote>]</code> (there is no
|
2021-09-12 07:36:54 +00:00
|
|
|
support for pushing from non-Git repos yet)</td>
|
|
|
|
<td><code>git push --all [<remote>]</code></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Update a remote repo with a single branch from the local repo</td>
|
|
|
|
<td><code>jj git push --branch <branch name>
|
|
|
|
[--remote <remote>]</code> (there is no support for
|
|
|
|
pushing from non-Git repos yet)</td>
|
|
|
|
<td><code>git push <remote> <branch name></code></td>
|
|
|
|
</tr>
|
2021-08-30 06:25:53 +00:00
|
|
|
<tr>
|
|
|
|
<td>Show summary of current work and repo status</td>
|
|
|
|
<td><code>jj st</code></td>
|
2021-09-12 07:36:54 +00:00
|
|
|
<td><code>git status</code></td>
|
2021-08-30 06:25:53 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Show diff of the current change</td>
|
|
|
|
<td><code>jj diff</code></td>
|
|
|
|
<td><code>git diff HEAD</code></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Show diff of another change</td>
|
|
|
|
<td><code>jj diff -r <revision></code></td>
|
|
|
|
<td><code>git diff <revision>^ <revision></code></td>
|
|
|
|
</tr>
|
2023-07-11 01:31:24 +00:00
|
|
|
<tr>
|
|
|
|
<td>Show diff from another change to the current change</td>
|
|
|
|
<td><code>jj diff --from <revision></code></td>
|
|
|
|
<td><code>git diff <revision></code></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Show diff from change A to change B</td>
|
|
|
|
<td><code>jj diff --from A --to B</code></td>
|
|
|
|
<td><code>git diff A B</code></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2021-12-16 06:53:45 +00:00
|
|
|
<tr>
|
|
|
|
<td>Show description and diff of a change</td>
|
|
|
|
<td><code>jj show <revision></code></td>
|
|
|
|
<td><code>git show <revision></code></td>
|
|
|
|
</tr>
|
2021-08-30 06:25:53 +00:00
|
|
|
<tr>
|
|
|
|
<td>Add a file to the current change</td>
|
|
|
|
<td><code>touch filename</code></td>
|
|
|
|
<td><code>touch filename; git add filename</code></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Remove a file from the current change</td>
|
|
|
|
<td><code>rm filename</code></td>
|
2023-07-11 03:41:34 +00:00
|
|
|
<td><code>git rm filename</code></td>
|
2021-08-30 06:25:53 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Modify a file in the current change</td>
|
|
|
|
<td><code>echo stuff >> filename</code></td>
|
2021-09-12 18:55:37 +00:00
|
|
|
<td><code>echo stuff >> filename</code></td>
|
2021-08-30 06:25:53 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Finish work on the current change and start a new change</td>
|
2022-08-25 22:18:14 +00:00
|
|
|
<td><code>jj commit</code></td>
|
2021-08-30 06:25:53 +00:00
|
|
|
<td><code>git commit -a</code></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2024-01-31 20:32:10 +00:00
|
|
|
<td>See log of ancestors of the current commit</td>
|
|
|
|
<td><code>jj log -r ::@</code></td>
|
2021-08-30 06:25:53 +00:00
|
|
|
<td><code>git log --oneline --graph --decorate</code></td>
|
|
|
|
</tr>
|
2023-11-11 12:53:33 +00:00
|
|
|
<tr>
|
2024-01-31 20:32:10 +00:00
|
|
|
<td>See log of all reachable commits</td>
|
|
|
|
<td><code>jj log -r 'all()'</code> or <code>jj log -r ::</code></td>
|
|
|
|
<td><code>git log --oneline --graph --decorate --branches</code></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Show log of commits not on the main branch</td>
|
|
|
|
<td><code>jj log</code></td>
|
|
|
|
<td>(TODO)</td>
|
2023-11-11 12:53:33 +00:00
|
|
|
</tr>
|
2023-12-20 22:50:17 +00:00
|
|
|
<tr>
|
|
|
|
<td>Search among files versioned in the repository</td>
|
2024-01-11 19:11:56 +00:00
|
|
|
<td><code>grep foo $(jj files)</code>, or <code>rg --no-require-git foo</code></td>
|
2023-12-20 22:50:17 +00:00
|
|
|
<td><code>git grep foo</code></td>
|
|
|
|
</tr>
|
2021-08-30 06:25:53 +00:00
|
|
|
<tr>
|
|
|
|
<td>Abandon the current change and start a new change</td>
|
2021-09-20 04:19:47 +00:00
|
|
|
<td><code>jj abandon</code></td>
|
2021-08-30 06:25:53 +00:00
|
|
|
<td><code>git reset --hard</code> (cannot be undone)</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Make the current change empty</td>
|
|
|
|
<td><code>jj restore</code></td>
|
|
|
|
<td><code>git reset --hard</code> (same as abandoning a change since Git
|
|
|
|
has no concept of a "change")</td>
|
|
|
|
</tr>
|
document the jj equivalent of git reset --soft
i did the following things:
1. make some changes to the working copy
2. run `jj commit`
3. before i added a description, i decided i didn't want to commit yet. in git, the way to do this is to delete the contents of the editor; git sees that it is blank and aborts the commit. in jj, this doesn't work, because descriptions are allowed to be empty.
now i have the following jj state:
```
; jj log --stat
@ pokrsyvs github@jyn.dev 2024-02-06 21:48:17.000 -05:00 ddd6217f
│ (empty) (no description set)
│ 0 files changed, 0 insertions(+), 0 deletions(-)
◉ lqqmzmku github@jyn.dev 2024-02-06 21:48:02.000 -05:00 HEAD@git b03bf3de
│ (no description set)
│ config/jj.toml | 2 +-
│ 1 file changed, 1 insertion(+), 1 deletion(-)
◉ xqkmwvwp github@jyn.dev 2024-02-06 21:47:08.000 -05:00 master b673f97b
```
i want to undo the most recent commit, `lqqmzmku`. i'm used to doing this with `git reset --soft HEAD~`, which makes the parent `xqkmwvwp` and leaves the change to `config/jj.toml` on disk while removing it from the git history; basically `lqqmzmku` would go back to being the working copy.
i found that `jj move` does what i want, but it took a lot of trawling the options, it wasn't obvious, and i couldn't find `git reset` mentioned in the docs.
2024-02-07 02:09:33 +00:00
|
|
|
<tr>
|
|
|
|
<td>Abandon the parent of the working copy, but keep its diff in the working copy</td>
|
2024-03-11 04:24:13 +00:00
|
|
|
<td><code>jj squash --from @-</code></td>
|
document the jj equivalent of git reset --soft
i did the following things:
1. make some changes to the working copy
2. run `jj commit`
3. before i added a description, i decided i didn't want to commit yet. in git, the way to do this is to delete the contents of the editor; git sees that it is blank and aborts the commit. in jj, this doesn't work, because descriptions are allowed to be empty.
now i have the following jj state:
```
; jj log --stat
@ pokrsyvs github@jyn.dev 2024-02-06 21:48:17.000 -05:00 ddd6217f
│ (empty) (no description set)
│ 0 files changed, 0 insertions(+), 0 deletions(-)
◉ lqqmzmku github@jyn.dev 2024-02-06 21:48:02.000 -05:00 HEAD@git b03bf3de
│ (no description set)
│ config/jj.toml | 2 +-
│ 1 file changed, 1 insertion(+), 1 deletion(-)
◉ xqkmwvwp github@jyn.dev 2024-02-06 21:47:08.000 -05:00 master b673f97b
```
i want to undo the most recent commit, `lqqmzmku`. i'm used to doing this with `git reset --soft HEAD~`, which makes the parent `xqkmwvwp` and leaves the change to `config/jj.toml` on disk while removing it from the git history; basically `lqqmzmku` would go back to being the working copy.
i found that `jj move` does what i want, but it took a lot of trawling the options, it wasn't obvious, and i couldn't find `git reset` mentioned in the docs.
2024-02-07 02:09:33 +00:00
|
|
|
<td><code>git reset --soft HEAD~</code></td>
|
|
|
|
</tr>
|
2023-05-07 01:54:08 +00:00
|
|
|
<tr>
|
|
|
|
<td>Discard working copy changes in some files</td>
|
|
|
|
<td><code>jj restore <paths>...</code></td>
|
2023-05-07 23:04:32 +00:00
|
|
|
<td><code>git restore <paths>...</code> or <code>git checkout HEAD -- <paths>...</code></td>
|
2023-05-07 01:54:08 +00:00
|
|
|
</tr>
|
2021-08-30 06:25:53 +00:00
|
|
|
<tr>
|
|
|
|
<td>Edit description (commit message) of the current change</td>
|
|
|
|
<td><code>jj describe</code></td>
|
|
|
|
<td>Not supported</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Edit description (commit message) of the previous change</td>
|
2021-12-13 06:40:16 +00:00
|
|
|
<td><code>jj describe @-</code></td>
|
2021-08-30 06:25:53 +00:00
|
|
|
<td><code>git commit --amend</code> (first make sure that nothing is
|
|
|
|
staged)</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Temporarily put away the current change</td>
|
2024-03-02 09:31:43 +00:00
|
|
|
<td><code>jj new @-</code> (the old working-copy commit remains as a sibling commit)<br />
|
|
|
|
(the old working-copy commit X can be restored with <code>jj edit X</code>)</td>
|
2021-08-30 06:25:53 +00:00
|
|
|
<td><code>git stash</code></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Start working on a new change based on the <main> branch</td>
|
2024-01-17 22:41:43 +00:00
|
|
|
<td><code>jj new main</code></td>
|
2023-05-07 23:04:32 +00:00
|
|
|
<td><code>git switch -c topic main</code> or
|
|
|
|
<code>git checkout -b topic main</code> (may need to stash or commit
|
|
|
|
first)</td>
|
2021-08-30 06:25:53 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Move branch A onto branch B</td>
|
2022-05-14 16:59:37 +00:00
|
|
|
<td><code>jj rebase -b A -d B</code></td>
|
2021-08-30 06:25:53 +00:00
|
|
|
<td><code>git rebase B A</code>
|
|
|
|
(may need to rebase other descendant branches separately)</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Move change A and its descendants onto change B</td>
|
|
|
|
<td><code>jj rebase -s A -d B</code></td>
|
|
|
|
<td><code>git rebase --onto B A^ <some descendant branch></code>
|
|
|
|
(may need to rebase other descendant branches separately)</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Reorder changes from A-B-C-D to A-C-B-D</td>
|
2024-03-19 10:19:27 +00:00
|
|
|
<td><code>jj rebase -r C -d A; jj rebase -s B -d C</code> (pass change IDs,
|
2021-10-27 21:17:57 +00:00
|
|
|
not commit IDs, to not have to look up commit ID of rewritten C)</td>
|
2021-08-30 06:25:53 +00:00
|
|
|
<td><code>git rebase -i A</code></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Move the diff in the current change into the parent change</td>
|
2021-11-10 18:46:10 +00:00
|
|
|
<td><code>jj squash/amend</code></td>
|
2021-08-30 06:25:53 +00:00
|
|
|
<td><code>git commit --amend -a</code></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Interactively move part of the diff in the current change into the
|
|
|
|
parent change</td>
|
2021-11-10 18:46:10 +00:00
|
|
|
<td><code>jj squash/amend -i</code></td>
|
2021-08-30 06:25:53 +00:00
|
|
|
<td><code>git add -p; git commit --amend</code></td>
|
|
|
|
</tr>
|
2022-11-19 22:11:35 +00:00
|
|
|
<tr>
|
|
|
|
<td>Move the diff in the working copy into an ancestor</td>
|
2024-03-11 04:24:13 +00:00
|
|
|
<td><code>jj squash --into X</code></td>
|
2022-11-19 22:11:35 +00:00
|
|
|
<td><code>git commit --fixup=X; git rebase -i --autosquash X^</code></td>
|
|
|
|
</tr>
|
2022-03-11 16:06:38 +00:00
|
|
|
<tr>
|
|
|
|
<td>Interactively move part of the diff in an arbitrary change to another
|
|
|
|
arbitrary change</td>
|
2024-03-11 04:24:13 +00:00
|
|
|
<td><code>jj squash -i --from X --into Y</code></td>
|
2023-07-31 16:01:21 +00:00
|
|
|
<td>Not supported</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Interactively split the changes in the working copy in two</td>
|
|
|
|
<td><code>jj split</code></td>
|
|
|
|
<td><code>git commit -p</code></td>
|
2022-03-11 16:06:38 +00:00
|
|
|
</tr>
|
2021-08-30 06:25:53 +00:00
|
|
|
<tr>
|
2023-07-31 16:01:21 +00:00
|
|
|
<td>Interactively split an arbitrary change in two</td>
|
2021-08-30 06:25:53 +00:00
|
|
|
<td><code>jj split -r <revision></code></td>
|
|
|
|
<td>Not supported (can be emulated with the "edit" action in
|
|
|
|
<code>git rebase -i</code>)</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Interactively edit the diff in a given change</td>
|
2022-12-18 03:56:21 +00:00
|
|
|
<td><code>jj diffedit -r <revision></code></td>
|
2021-08-30 06:25:53 +00:00
|
|
|
<td>Not supported (can be emulated with the "edit" action in
|
|
|
|
<code>git rebase -i</code>)</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Resolve conflicts and continue interrupted operation</td>
|
2021-11-10 18:46:10 +00:00
|
|
|
<td><code>echo resolved > filename; jj squash/amend</code> (operations
|
|
|
|
don't get interrupted, so no need to continue)</td>
|
2021-08-30 06:25:53 +00:00
|
|
|
<td><code>echo resolved > filename; git add filename; git
|
|
|
|
rebase/merge/cherry-pick --continue</code></td>
|
|
|
|
</tr>
|
2022-03-11 21:07:46 +00:00
|
|
|
<tr>
|
|
|
|
<td>Create a copy of a commit on top of another commit</td>
|
|
|
|
<td><code>jj duplicate <source>; jj rebase -r <duplicate commit> -d <destination></code>
|
|
|
|
(there's no single command for it yet)</td>
|
|
|
|
<td><code>git co <destination>; git cherry-pick <source></code></td>
|
|
|
|
</tr>
|
2024-01-10 23:45:12 +00:00
|
|
|
<tr>
|
|
|
|
<td>Find the root of the working copy (or check if in a repo)</td>
|
|
|
|
<td><code>jj workspace root</code></td>
|
|
|
|
<td><code>git rev-parse --show-toplevel</code></td>
|
|
|
|
</tr>
|
2021-09-12 07:25:53 +00:00
|
|
|
<tr>
|
|
|
|
<td>List branches</td>
|
2022-06-09 20:58:34 +00:00
|
|
|
<td><code>jj branch list</code></td>
|
2021-09-12 07:25:53 +00:00
|
|
|
<td><code>git branch</code></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Create a branch</td>
|
2022-06-09 20:58:34 +00:00
|
|
|
<td><code>jj branch create <name> -r <revision></code></td>
|
2021-09-12 07:25:53 +00:00
|
|
|
<td><code>git branch <name> <revision></code></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Move a branch forward</td>
|
2022-06-09 20:58:34 +00:00
|
|
|
<td><code>jj branch set <name> -r <revision></code></td>
|
2021-09-12 07:25:53 +00:00
|
|
|
<td><code>git branch -f <name> <revision></code></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Move a branch backward or sideways</td>
|
2022-06-09 20:58:34 +00:00
|
|
|
<td><code>jj branch set <name> -r <revision> --allow-backwards</code></td>
|
2021-09-12 07:25:53 +00:00
|
|
|
<td><code>git branch -f <name> <revision></code></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Delete a branch</td>
|
2022-06-09 20:58:34 +00:00
|
|
|
<td><code>jj branch delete <name> </code></td>
|
2021-09-12 07:25:53 +00:00
|
|
|
<td><code>git branch --delete <name></code></td>
|
|
|
|
</tr>
|
2021-08-30 06:25:53 +00:00
|
|
|
<tr>
|
|
|
|
<td>See log of operations performed on the repo</td>
|
|
|
|
<td><code>jj op log</code></td>
|
|
|
|
<td>Not supported</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Undo an earlier operation</td>
|
2022-05-01 04:55:34 +00:00
|
|
|
<td><code>jj [op] undo <operation ID></code>
|
2021-11-20 18:30:21 +00:00
|
|
|
(<code>jj undo</code> is an alias for <code>jj op undo</code>)
|
|
|
|
</td>
|
2021-08-30 06:25:53 +00:00
|
|
|
<td>Not supported</td>
|
|
|
|
</tr>
|
2023-11-14 01:47:36 +00:00
|
|
|
<tr>
|
|
|
|
<td>Create a commit that cancels out a previous commit</td>
|
|
|
|
<td><code>jj backout -r <revision></code>
|
|
|
|
</td>
|
2023-11-14 22:35:35 +00:00
|
|
|
<td><code>git revert <revision></code></td>
|
2023-11-14 01:47:36 +00:00
|
|
|
</tr>
|
2021-08-30 06:25:53 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|