git生成补丁和应用补丁
本文记录了使用 git diff 命令生成 patch 和 git appy 应用 patch 的基本操作方法。
git diff 生成 patch#
git diff -- Classes > ~/bugfix/Classes.patch
git diff --staged -- Classes > ~/bugfix/Classes.patch
git stash show stash@{1} --patch > patch
git appy 应用 patch#
检查patch文件:
查看是否能应用成功:
应用 patch:
中途放弃:git am --abort
refs#
git format-patch 生成指定commit的补丁
使用 git format-patch 生成patch和应用patch
如何使用 git 生成patch 和打入patch
Git 打补丁-- patch 和 diff 的使用