ローカル参照と公開済みの全モードを含む完全パッケージをインストールします。
install diffdiff実用的な流れは .patched ファイルを作成し、元ファイルを置き換えるのは -r のときだけです。
diff <old> <new> [options]diff <old> <new>3 行のコンテキスト付き unified
diff <old> <new> -c <lines>コンテキストを 0〜20 行に設定する
diff <old> <new> -qファイルが異なるかだけを表示する
diff <old> <new> -o <patch>patch <file> <patch>パッチ結果を <file>.patched に書く
patch <file> <patch> -o <dst>別のファイルへ結果を書く
patch <file> <patch> -r元ファイルを原子的に置き換える
patch <file> <patch> -f-r 以外の既存出力を置き換えられるようにする
.patched を作り、-o <dst> で別の出力先、-r で元ファイル置換を選びます。
各テキストファイルは 4 MiB、20000 行までで、バイナリは拒否されます。patch は書き込み前に全コンテキスト行を検証するため、別バージョン向けのパッチは変更前に失敗します。
用意された例をページ上でそのまま実行できます。結果は事前に生成されてブラウザに表示され、サーバーではターミナルコマンドを実行しません。
現在の互換バージョンをインストールします。全機能は Base、縮小版は Minimum を選び、すでに導入済みのモジュール更新には upgrade を使います。
Base と Minimum は同じ現在のモジュールリリースの二つのパッケージです。
ローカル参照と公開済みの全モードを含む完全パッケージをインストールします。
install diff縮小パッケージをインストールします。ローカルリファレンスは含まれず、
install diff -mこの公開済みバージョンを正確に指定してインストールします。
install diff -v 1.1.3upgrade が互換性を確認し、必要な場合だけブロックを置換します。
upgrade diffコアや他のモジュールに触れず拡張ブロックを削除します。
install diff -u例はコピーできますが、サイトは実行しません。実プロジェクトではパス、権限、破壊的オプションを確認してください。
cd \sandbox | diff workspace/original.txt workspace/updated.txt--- workspace/original.txt
+++ workspace/updated.txt
@@ -1,2 +1,2 @@
-alpha
+alpha revieweddiff workspace/original.txt workspace/updated.txt -c 1--- workspace/original.txt
+++ workspace/updated.txt
@@ -1,2 +1,2 @@
-alpha
+alpha revieweddiff workspace/original.txt workspace/updated.txt -qDifferent yes
Old workspace/original.txt
New workspace/updated.txtdiff workspace/original.txt workspace/updated.txt -o tmp/workspace.patchSaved tmp/workspace.patch
Size 148 Bpatch workspace/original.txt tmp/workspace.patchSource workspace/original.txt
Patched workspace/original.txt.patchedpatch workspace/original.txt tmp/workspace.patch -o tmp/patched.txtSource workspace/original.txt
Patched tmp/patched.txtpatch workspace/original.txt tmp/workspace.patch -o tmp/current.txt -fSource workspace/original.txt
Patched tmp/current.txt
Replace explicitpatch workspace/original.txt tmp/workspace.patch -rSource workspace/original.txt
Patched workspace/original.txtdiff missing.txt workspace/updated.txtファイルが見つかりません: missing.txtsandbox/workspace/original.txt例では、保護されたドキュメント用 /sandbox/ ワークスペースのファイルまたはディレクトリを使います。
alpha
beta
gamma