パッチはどういうときに役立てるのか、自分的なメモです。 diffコマンドの詳細解説 http://x68000.q-e-d.net/~68user/unix/pickup?diff patchコマンドの詳細解説 http://x68000.q-e-d.net/~68user/unix/pickup?patch 実際使うとしたら、大体以下の2通りぐらいかなと 単一ファイルに対するパッチ 1つ目のパターンは、一つのファイルに対するパッチを作成したいというとき。
まとめ $ git diff --no-prefix HEAD~ > thisis.patch $ patch --dry-run -p0 < thisis.patch $ patch -p0 < thisis.patch git diffに--no-prefixをつける事で、普通のpatchで当てられるパッチファイルを出力できます。この例ではHEADの1個前*1からHEAD*2までのパッチです。 普通のpatchコマンドのほうの知識があまり無くて-p0がいまいちよく分からないんですが、git diff --no-prefixで作成したパッチファイルを当てるには必要みたいです。--dry-runは、実際には当てないけど当てた場合の結果を出力します。なので、まずは--dry-runで確認して、問題が無ければ実際にパッチを当てます。 エントリー書いた後に教えてもらった補足 patch -p1の
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く