Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Clone

Goal

In which you learn how to use Git features directly through jj.

Enough with fictional repositories. Clone this one:

https://codeberg.org/arialdo/jj-playground1.git

It contains code from the React.js Tic Tac Toe tutorial. Clone it only using jj. Check jj git --help for available options.

Solution

That was an easy one, right?

$ jj git clone https://codeberg.org/arialdo/jj-playground1.git
$ cd jj-playground1

Running jj log, you'll see Jujutsu shows only 2 Changes and marks one as a diamond . This means it is immutable.

@  s            empty
◆  z            Click alternates Xs and Os main
│
~

As a reference, here are the symbols used by jj log to represent nodes:

Symbol Meaning
Mutable node
Immutable node
@ The Current Change
@ The Current Change, immutable

Immutable nodes prevent you from modifying already-published commits. For simplicity, we'll disable this protection, adding a local bookmark (i.e., Jujutsu's branches) for each remote branch:

$ jj bookmark track '*' --remote origin

Good, you are ready to go:

$ jj log

@  p            empty
○  zx           Click alternates Xs and Os main
○  v            Click sets a X
○  s            Square has state
│ ○  o          Play instructions
│ ○  kx         Play manual
├─╯
○  n            Square is interactive
○    ru         Board() invokes Square()
├─╮
○ │  ym         fix name: Square -> Board
○ │  x          WIP delete me
○ │  yz         LICENSE
○ │  ws         A board full of X
├─╯
○  kk           Displays X X
○  wx           Fails
○  rx           Scaffold applicatio
◆  zz      🔒   empty