diff --git a/docs/git-comparison.md b/docs/git-comparison.md index 2d779317af..18895684da 100644 --- a/docs/git-comparison.md +++ b/docs/git-comparison.md @@ -22,19 +22,21 @@ various use cases. 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). -* **No need for bookmark names (but they are supported).** Git lets you check out - a commit without attaching a bookmark. 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 bookmark). However, Jujutsu keeps track of all visible heads +* **No need for branch names (but they are supported as + [bookmarks](glossary.md#bookmark)).** Git lets you check out a commit without + attaching a branch to it. 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/bookmark). However, Jujutsu keeps track of all visible heads (leaves) of the commit graph, so the commits won't get lost or garbage-collected. -* **No current bookmark.** Git lets you check out a bookmark, making it the 'current - bookmark', and new commits will automatically update the bookmark. This is +* **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 bookmark'; instead, you update bookmarks - manually. For example, if you start work on top of a commit with a bookmark, - new commits are created on top of the bookmark, then you issue a later command - to update the bookmark. + + Jujutsu does not have a corresponding concept of a 'current bookmark'; + instead, you update bookmarks manually. For example, if you start work on top + of a commit with a bookmark, new commits are created on top of the bookmark, + then you issue a later command to update the bookmark. * **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). @@ -43,11 +45,10 @@ various use cases. 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` bookmark, you'll get a bookmark by that - name in your local repo as well. If you then move it and push back to the - remote, the `main` bookmark on the remote will be updated. - [Details](bookmarks.md). +* **Bookmarks/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 bookmark by that + name in your local repo. If you then move it and push back to the remote, the + `main` branch on the remote will be updated. [Details](bookmarks.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 @@ -56,7 +57,7 @@ various use cases. * **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 bookmark" + 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`). @@ -107,16 +108,20 @@ parent.
jj git clone <source> <destination> [--remote <remote name>]
(there is no support
for cloning non-Git repos yet)git clone <source> <destination> [--origin <remote name>]
git clone <source> <destination&/gt; [--origin <remote name>]
jj git fetch [--remote <remote>]
(there is no
support for fetching into non-Git repos yet)git fetch [<remote>]
jj git push --all [--remote <remote>]
(there is no
support for pushing from non-Git repos yet)git push --all [<remote>]
jj log -r 'all()'
or jj log -r ::
git log --oneline --graph --decorate --bookmarks
git log --oneline --graph --decorate --branches
git stash
jj new main
git switch -c topic main
or
git checkout -b topic main
(may need to stash or commit
first)jj rebase -b A -d B
git rebase B A
- (may need to rebase other descendant bookmarks separately)git rev-parse --show-toplevel
jj bookmark list
git bookmark
git branch
jj bookmark create <name> -r <revision>
git bookmark <name> <revision>
git branch <name> <revision>
jj bookmark set <name> -r <revision>
git bookmark -f <name> <revision>
git branch -f <name> <revision>
jj bookmark set <name> -r <revision> --allow-backwards
git bookmark -f <name> <revision>
git branch -f <name> <revision>
jj bookmark delete <name>
git bookmark --delete <name>
git branch --delete <name>