jj commands
I started using jj-vcs .
Getting used to it took me about 3 weeks of using it exclusively. When I was just starting I found this blog
from Danver Braganza about their
most commonly used jj commands which helped me a lot in figuring out which commands to
actually focus on. Now that I have been using it for a while and feel pretty comfortable, I thought I would
make a list of the commands I use most frequently since jj has been evolving pretty fast and
I converged on a slightly different workflow. I did not do a systematic analysis like Danver and instead
just jotted down the commands that came to my mind. The following is a list of those commands and how I use
them in my workflow. This is not a tutorial.
jj newnew. Coming from git it might be surprising but this is also the command you use to
create what would be called a "branch" in git. You just say jj new BRANCH_POINT and you have
just started another line of change from that BRANCH_POINT. Even more surprisingly, you will be using this
command when you want to check out some old commit by creating a new empty commit on top of that commit and
browsing the files there. Having to create empty commits just to read felt strange initially but jj
automatically garbage collectes empty commits so you don't need to worry about filling up your history
with empty commits. new is also used to create merge commits jj new PARENT_A PARENT_B ...
and it can also be used to insert commits between two commits jj new -A PRED -B SUCC.
jj st[atus]git status. The only difference being that
jj does not have a staging area like git.
jj loggit diff. The
output is closer to what you would see with git log --all --oneline --graph. I personally found
the default output a little too verbose so I set templates.log = "builtin_log_oneline" in my
config. Once you are familiar with revsets, you
can use it to do everything you could do with git log.
jj desc[ribe]jj commit command that
can be used as well which does describe followed by new.
jj editjj new for that purpose since you don't have to worry about accidentally changing the
revision.
jj show and jj diffjj undojj rebase [-s|-b|-r] REV [-o|-A|-B] REVjj git push --named NAME=REVjj git push -b BOOKMARKjj bookmark advance