使用git作patch有以下几种
1.自己修改了一些代码,或者加了一些文件,然后做patch,方法如下:
(1)修改了代码
上面是作通用的patch,接下来是做当前树的patch
这样,对一个文件的修改的patch就做完了
(2)文件添加的patch
首先添加一个文件,然后再commit
然后再生成patch
这样,添加一个文件后作的patch就生成出来了
2. 当从服务器clone下来了最新的代码,然后想知道中间的某一部分的代码的patch,
可以使用如下方法获得修改的内容,并生成patch
这样,就把所有的patch都给列出来了,可以根据需要去进行选择
3.在不同的版本的间做patch
先列出来tag,然后再根据需要,进行patch生成,例如想知道2.6.38到2.6.39-rc2之间的ext2文件系统都做了什么
这样就搞定了,那个diff文件可以重新命个名,比如叫ext2_modify.patch