Last active
August 29, 2015 14:22
-
-
Save kazu69/7ea0ae5aa4f0b838ae71 to your computer and use it in GitHub Desktop.
patchのあれこれ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://d.hatena.ne.jp/mrgoofy33/20101019/1287500809 | |
# http://d.hatena.ne.jp/kanonji/20110222/1298341934 | |
# ファイル差分を取る | |
diff -c(or -u) file.origin file.new > diff.patch | |
# git で差分を取る | |
git diff --no-prefix > diff.patch | |
# HEADで差分を指定 | |
git diff HEAD~1 --no-prefix > diff.patch | |
# メール用のフォーマット | |
git format-patch > diff.patch | |
# dry run 適用 | |
patch --dry-run -p0 < diff.patch | |
# patch 適用 | |
patch -p0 < diff.patch | |
# エラーが出たら | |
patch -p0 --ignore-whitespace < diff-file | |
# assume reversedとか聞かれなくする | |
patch -p0 -t --ignore-whitespace < diff-file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment