#author("2025-12-19T18:04:22+09:00","","")
#author("2025-12-19T18:15:44+09:00","","")
#topicpath


///////////////////////////////////////////////////////////////////////////////
* 目次 [#ea18abac]
#contents();

///////////////////////////////////////////////////////////////////////////////
* jj [#f4eeb2f6]
- 高速な git 互換ツール

///////////////////////////////////////////////////////////////////////////////
* 入手 [#va712001]
- Debian13 にはパッケージがないので、ソースコードからビルドする
 $ https://github.com/jj-vcs/jj.git
 $ cd jj
 $ cargo build --release
- 以上で、コマンドファイル target/release/jj が生成される

///////////////////////////////////////////////////////////////////////////////
* 使い方 [#gec490f8]
- git repository で jj を使えるようにする
 $ cd <git-repository>
 $ jj git init --colocate
-- ここで、 jj に関する設定は、このディレクトリに作成された .jj ディレクトリ配下に配置される。ここでの jj コマンドの使用を無効化したい場合は、この .jj を削除する。

//=============================================================================
** コマンドラインオプション [#fcc6dac2]
|~jj コマンド                                       |~git 相当コマンド         |~説明・備考                                                             |
|jj init                                            |git init                  |新しいリポジトリを作成(jjはデフォルトでGitバックエンド)               |
|jj git clone <url>                                 |git clone <url>           |Gitリポジトリをクローンし、jjで初期化                                   |
|jj status                                          |git status                |作業中の変更を表示(jjでは自動スナップショット済み)                    |
|jj log                                             |git log                   |コミット履歴を表示(jjの方がデフォルトでツリー表示がきれい)            |
|jj log                                             |git log                   |コミット履歴を表示(jjで全件表示するには -r "all()" が引数に必要)      |
|jj diff                                            |git diff                  |変更差分を表示                                                          |
|(不要)                                           |git add <file>            |jjでは作業中の変更が自動でコミットされる                                |
|jj describe -m "msg" または jj new -m "msg"        |git commit -m "msg"       |コミットメッセージを設定(describeで既存変更、newで新しいコミット作成) |
|jj describe -m "new msg"                           |git commit --amend        |現在のコミットのメッセージを編集(自動で子孫をリベース)                |
|jj checkout <bookmark> または jj new <bookmark>    |git checkout <branch>     |bookmark(Gitのbranch相当)に切り替えまたは新しい変更を作成             |
|jj new -m "msg" <bookmark>                         |git switch -c <branch>    |新しいbookmarkを作成して切り替え                                        |
|jj bookmark create <name>                          |git branch <name>         |新しいbookmark(branch)を作成                                          |
|jj bookmark delete <name>                          |git branch -d <name>      |bookmarkを削除                                                          |
|jj bookmark list                                   |git branch -l             |bookmark一覧                                                            |
|jj merge                                           |git merge <branch>        |現在のbookmarkにマージ(自動でマージコミット作成)                      |
|jj rebase -d <bookmark>                            |git rebase <branch>       |変更を指定のbookmark上にリベース(子孫も自動リベース)                  |
|jj rebase -i                                       |git rebase -i             |インタラクティブにリベース                                              |
|(不要)                                           |git rebase --continue     |jjは競合をコミット内に記録するため、rebaseが中断しない                  |
|jj new -m "stash"                                  |git stash                 |一時的に変更をスタッシュ(新しい変更として保存)                        |
|jj squash -r <stash>                               |git stash pop             |スタッシュを適用(squashで親に統合)                                    |
|jj restore -r <commit>                             |git reset --hard <commit> |指定コミットの状態にリセット                                            |
|jj squash -r <commit>                              |git reset --soft <commit> |変更を親に統合(soft reset相当)                                        |
|jj move --from <commit> --to @                     |git cherry-pick <commit>  |指定コミットの変更を現在の作業中に移動                                  |
|jj git fetch && jj rebase -d main@origin           |git pull                  |fetch + rebase(pull相当)                                              |
|jj git fetch                                       |git fetch                 |リモートから取得                                                        |
|jj git push                                        |git push                  |リモートにpush(--allで全bookmarkなど)                                 |
|jj show <commit>                                   |git show <commit>         |指定コミットの詳細を表示                                                |
|jj file annotate <file>                            |git blame <file>          |ファイルの変更履歴を表示                                                |
|jj new -r <commit> -m "revert" または jj op revert |git revert <commit>       |コミットを元に戻す(revert)                                            |
|jj config [optoin]                                 |git config [option]       |                                                                        |

///////////////////////////////////////////////////////////////////////////////
* 設定 [#jj-config]
- jj の設定コマンド
-- コマンドラインで設定追加する
 $ jj config set <config-option>
-- 設定ファイルの編集画面を呼び出す
 $ jj config edit --user
- 設定ファイルは下記に作成される:
 ${HOME}/.config/jj/config.toml

- ユーザの名前、メールアドレスを設定
 $ jj config set --user user.name <user-name>
 $ jj config set --user user.email <mail-address>

- コミットログを全て表示する(デフォルトでは最新2件までしか表示されない)
-- 以下を jj config edit --user で追加する:
 [templates]
 log = "builtin_log_compact_full_description"


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS