Wandering Around
Important
You realize that
jj newcan be used to safely browse the repository.
Running jj new X creates a new Change containing the exact same
content as X. But it’s not X, it’s a separate jchange, so even if
you edit files, you won’t modify X. So, it’s a safe sandbox to
explore what’s inside X on your disk.
Interestingly, if you jump away with a second jj new and leave your
Buffer Change empty, Jujutsu automatically abandons it.
This is a brilliant default! You can jump back and forth targeting
different Changes using jj new:
- Without polluting your history with empty leftovers.
- Without risking unintentional modifications to historical commits.
In practice, this is a very cheap way to gain read-only access to your entire repository.
Conflict Resolution
Interestingly enough, the same mini-workflow:
jj new && (jj squash | jj revert)
is exceptionally handy for resolving conflicts. It’s time to tackle this topic!