2011年2月24日 星期四

Generate git patch

step1:
#git format-patch -o /tmp/ xxxxx^..xxxx
^上一筆
..到
xxxxx^..xxxx : 給範圍
ex:

git format-patch -o /tmp/ 401dcd873a6550158429999039cc3c1fcbbc3ee9^..401dcd873a6550158429999039cc3c1fcbbc3ee9

step2:
Using vi to modify BSP (replace)
:%s/xxxxx/xxxx

step3: Patch file
#git --reject /tmp/xxxx.patch
(
if successfully,
this patch step3 is done
else
Please go step4. Please manually resolve rejected hunk!!
)


step4:
If patch successfully, you can git add
#git add xxxx file name

step5:
#git am --resolved

step6:
#git push