git生成patch文件

一、通过git diff 命令生成patch文件
1.还未提交的修改
git diff > commit.patch

2.已提交的修改
git diff 3da71ca35 8b5100cdcd > commit.patch

注)3da71ca35 在8b5100cdcd 前面
3.已经add但是未commit的修改
git diff --cached > commit.patch
4.检查patch是否可以应用
git apply --check commit.patch
5.打补丁
git apply commit.patch

  

posted @ 2022-11-01 17:08  轻轻的吻  阅读(2573)  评论(0编辑  收藏  举报