patch:对某些文件的改动,可以加到任何一个分支或版本上(可能有冲突)。
1,修改代码
vi drivers/bluetooth/btusb.c2.提交代码
git commit -am "xxxxxx"
2,把代码添加到git管理仓库
git add drivers/bluetooth/btusb.c 或者 git add -A
3,提交修改
git commit -m "xxxxxx"
4,查看日志
git log
5,生成patch
git format-patch HEAD^ --stdout >tuhuolong.patch (保存tuhuolong.patch)
6,退回去git reset HEAD^
回滚后的代码依然可以重新提交
7,运用patch命令:git am tuhuolong.patch
本文介绍如何使用Git进行代码修改、提交、生成补丁文件及应用补丁等操作流程。涉及的具体步骤包括修改代码、提交更改、查看日志、生成并应用补丁。
7161

被折叠的 条评论
为什么被折叠?



