git format-patch 生成指定commit的补丁

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sinat_29891353/article/details/80803103

官方解释:
The first rule takes precedence in the case of a single . To apply the second rule, i.e., format everything since the beginning of history up until , use the –root option: git format-patch –root . If you want to format only itself, you can do this with git format-patch -1 commit .

git format常用命令:
git format-patch -3 //从当前分支最新提交点往下共生成3个补丁
git format-patch -1 指定commit号 //生成指定commit号的补丁
eg:git format-patch 5f123e379cc97c317d6094bcfa2281e1189d61f3
生成5f123e379cc97c317d6094bcfa2281e1189d61f3号的补丁,该commit号不一定在该分支开头,可以在该分支的任意位置。

猜你喜欢

转载自blog.csdn.net/sinat_29891353/article/details/80803103