There are several types of generate/apply patches in linux world
1. basic diff/patch
generate : diff -Nur file1 file2 > file1_file2.patch
apply : under file1's folder, patch -p 0 < file1_file2.patch
************ NOTES ***********
a. patch -p n means ignore first n directory levels in file1_file2.patch file part.
b. patch can apply to svn/git patches
2. SVN diff/patch
generate : svn diff file1 > ~/file1_fixes.patch
apply : use 1(diff/patch) to apply patch
3. GIT diff/patch
generate : git diff file1
apply : git apply file1.patch
************ NOTES ***********
a. always do --stat and --check before applying a patch through git
git apply --stat file1.patch
git apply --check file1.patch
b. git am can use to replace git apply, with git am can give signoff option
git am --signoff < fix_empty_poster.patch
沒有留言:
張貼留言