コンテンツにスキップ

Jujutsu (jj)

Git と共存する次世代 VCS。Git の g prefix に対応させて j prefix で alias を揃えている。

概念gitjj
branchgit branchjj bookmark
checkoutgit switchjj edit / jj new
staginggit add不要 (working copy = stage)
stashgit stash不要 (jj new するだけ)
amendgit commit --amendjj describe / jj squash
revertgit revertjj backout
refloggit reflogjj operation log
worktreegit worktreejj workspace
blamegit blamejj file annotate
remotegit push/fetchjj git push/fetch
項目
Default commandlog
Pagerless -FRX
Diff editor:builtin
Merge editor:builtin
Auto local bookmarkfalse
AliasCommand説明
jjjbase command
jljj loglog
jlljj log --template builtin_log_oneline1 行 log
jlajj log -r "all()"全 revision
jsjj statusstatus
jdjj diffworking copy の diff
jdsjj diff --statdiff の stat
jDjj diff -r @-親の diff
AliasCommand説明
jcjj commit現在の変更を確定
jcijj commit --interactiveinteractive commit
jnjj new新しい空の変更を作成
jejj edit既存の変更を edit
jdejj describedescription を編集
AliasCommand説明
jajj abandon変更を破棄
jujj undo直前の操作を取り消し
jsqjj squash親に squash
jsijj squash --interactiveinteractive squash
jspjj split変更を分割
jrjj rebaserebase
AliasCommand
jrtjj restore
jshjj show
AliasCommand説明
jbjj bookmark list一覧
jbcjj bookmark create作成
jbdjj bookmark delete削除
jbmjj bookmark move移動
jbrnjj bookmark renamerename
AliasCommand説明
jfjj git fetchfetch
jpjj git pushpush
jfrjj git fetch && jj rebase -d "trunk()"fetch して rebase
AliasCommand説明
jbljj file annotateblame 相当
jfljj file listfile 一覧
jopjj operation logreflog 相当
ljlazyjjTUI

config.toml に定義した revset aliases。jj log -r "wip" のように使う。

Alias定義説明
wipdescription(regex:"^\\[(wip|WIP|todo|TODO)\\]")[wip][TODO] で始まる変更
recentcommitter_date(after:"1 month ago")直近 1 ヶ月の変更
todaycommitter_date(after:"today 00:00")今日の変更
unpushedmine() & mutable()自分の未 push の変更
readymutable() & ~wip & ~empty()push 可能な変更 (WIP でなく空でもない)
immutable_heads()trunk() | tags()immutable な先頭
Terminal window
# WIP な変更だけ表示
jj log -r "wip"
# 今日の作業を確認
jj log -r "today"
# push 準備できた変更
jj log -r "ready"
# 未 push の自分の変更
jj log -r "unpushed"
Command説明
jsw [change]変更を選択して edit
jpso [bookmark]bookmark を選択して push
jPso [bookmark]bookmark を選択して force push
jifit2 つの変更を選択して diff 表示
jdif [N]N 世代前からの diff
jswc [name]bookmark を @ に作成
jrn [old] [new]bookmark を rename
jnew [change]選択した変更から新規作成
jedit [change]選択した変更を edit
jrbinteractive rebase
jsquash [target]選択した target に squash
jbd_skbookmark を選択して削除
jbm_skbookmark を @ に移動
Command説明
jwtinteractive menu
jwt listworkspace 一覧
jwt cd [name]workspace に移動 (引数なしで interactive 選択)
jwt addworkspace を作成
jwt rmworkspace を削除

短縮形: jwtcd, jwtadd, jwtrm, jwtls