Common patch and patch using git fight

Reference blog:

https://www.cnblogs.com/laoxiaobaiup/p/9455088.html

https://blog.csdn.net/u012701023/article/details/82984026

1. 

diff -u oldfile newfile > 1.patch

 

2. Place the patch hit oldfile, note p1 refers to ignore the first level directory, a directory which refers 1.patch file

patch  -p1 oldfile < 1.patch

 

3. Use git hit patch 

git format-patch HEAD^

git format-patch commit_id1..commit_Id2

Guess you like

Origin www.cnblogs.com/jyfyonghu/p/11317766.html