patch and diff
The Ten Minute Guide to diff and patch
对于文件
diff -u original.c new.c > original.patch
patch original.c < original.patch
对于文件夹
diff -rupN original/ new/ > original.patch
patch -Np1 < original.patch
在github 有人有不同的方法来处理
diff -ruN orig/ new/ > file.patch
# -r == recursive, so do subdirectories
# -u == unified style, if your system lacks it or if recipient may not have it, use "-c"
# -N == treat absent files as empty
patch -s -p0 < file.patch
# -s == silent except errors
# -p0 == needed to find the proper folder