Cloning a remote
Reset your progress
Reset your progress
To reset your progress to the start of this chapter, run the following command:
curl https://s2p2.github.io/jj-for-everyone/reset.sh | bash -s clone
cd ~/jj-tutorial/repo
While we started this tutorial with jj git init, it's more common to begin by cloning a repository that already exists.
Let's simulate this by deleting our local repository.
cd ~
rm -rf ~/jj-tutorial/repo
And cloning it from the remote:
jj git clone ~/jj-tutorial/remote ~/jj-tutorial/repo
The jj git clone command takes a <source> and a <destination>. It also automatically sets up the source as a remote named origin.
Since this is a new local clone, re-apply the repo-specific authorship configuration:
cd ~/jj-tutorial/repo
jj config set --repo user.name "Alice"
jj config set --repo user.email "alice@local"
jj metaedit --update-author
Let's check with jj log:
@ upopmymm alice@local 2025-09-06 20:42:45 25716c6f │ (empty) (no description set) ◆ ytwonzvp alice@local 2025-09-06 20:42:20 main git_head() 0a518bdd │ Add project description to readme ~
The ~ symbol indicates that older, "uninteresting" commits are hidden by default. To view the entire history, use jj log --revisions 'all()' or jj log -r 'all()':
@ upopmymm alice@local 2025-09-06 20:42:45 25716c6f │ (empty) (no description set) ◆ ytwonzvp alice@local 2025-09-06 20:42:20 main git_head() 0a518bdd │ Add project description to readme ◆ psnzzpwy alice@local 2025-09-06 20:41:56 02181db9 │ Add readme with project title ◆ zzzzzzzz root() 00000000
Our repository was successfully restored from the remote.