如何使用git 生成patch
2017-02-16 17:36
417 查看
1,下载代码
Git clone git://git.kernel.org/pub/scm/Linux/kernel/git/padovan/bluetooth-next-2.6.git
cd bluetooth-next-2.6
2,修改代码
vi drivers/bluetooth/btusb.c
3,把代码添加到git管理仓库
git add drivers/bluetooth/btusb.c
4,提交修改
git commit -m "Added atheros3012 Chip Firmware download support"
5,查看日志
git log <== to git the previous commit hash code.
6,生成patch
git format-patch -s 1bbe3c8c197a35f79bfddaba099270a2e54ea9c7
please replace the hash code with your repo previous commit.
then you can find the patch under repo directory.
then mail your patch to configuration admin.
或者使用
git format-patch HEAD^ <==最近的1次commit的patch
git format-patch HEAD^^ <==最近的2次commit的patch
git format-patch HEAD^ <==最近的3次commit的patch
git format-patch HEAD^ <==最近的4次commit的patch
git format-patch HEAD^^^^^ <==不支持!!!!error!!!
7,退回去
git reset --hard 1bbe3c8c197a35f79bfddaba099270a2e54ea9c7
8.将补丁打上去。
patch -p1 < 0001-Added-liuxingde-test.patch
注: 0001-Added-liuxingde-test.patch为想要打的补丁的名字。运行该命令需在git项目的要目录下。
转载自 http://blog.csdn.net/liuxd3000/article/details/25798065
Git clone git://git.kernel.org/pub/scm/Linux/kernel/git/padovan/bluetooth-next-2.6.git
cd bluetooth-next-2.6
2,修改代码
vi drivers/bluetooth/btusb.c
3,把代码添加到git管理仓库
git add drivers/bluetooth/btusb.c
4,提交修改
git commit -m "Added atheros3012 Chip Firmware download support"
5,查看日志
git log <== to git the previous commit hash code.
6,生成patch
git format-patch -s 1bbe3c8c197a35f79bfddaba099270a2e54ea9c7
please replace the hash code with your repo previous commit.
then you can find the patch under repo directory.
then mail your patch to configuration admin.
或者使用
git format-patch HEAD^ <==最近的1次commit的patch
git format-patch HEAD^^ <==最近的2次commit的patch
git format-patch HEAD^ <==最近的3次commit的patch
git format-patch HEAD^ <==最近的4次commit的patch
git format-patch HEAD^^^^^ <==不支持!!!!error!!!
7,退回去
git reset --hard 1bbe3c8c197a35f79bfddaba099270a2e54ea9c7
8.将补丁打上去。
patch -p1 < 0001-Added-liuxingde-test.patch
注: 0001-Added-liuxingde-test.patch为想要打的补丁的名字。运行该命令需在git项目的要目录下。
转载自 http://blog.csdn.net/liuxd3000/article/details/25798065
相关文章推荐
- 如何使用git 生成patch 和打入patch【转】
- 添加一个文件夹及一些文件如何使用git生成patch
- 添加一个文件夹及一些文件如何使用git生成patch
- 添加一个文件夹及一些文件如何使用git生成patch
- 如何使用git 生成patch 和打入patch 标签: gitpatch【转】
- 如何使用git 生成patch
- 添加一个文件夹及一些文件如何使用git生成patch git补丁 新文件 图片资源文件
- 如何使用git 生成patch 和打入patch
- 如何使用git 生成patch
- 如何使用git 生成patch 和打入patch
- 如何使用git 生成patch
- 使用 Git 生成标准 Patch
- git:如何用git-am来合并git format-patch生成的patch
- Git Patch使用: 生成,导入,解决冲突
- git 生成patch和使用patch
- git 生成patch和使用patch
- 使用git-am合并git format-patch生成的一系列的patch
- [转]使用git-am合并git format-patch生成的一系列的patch
- 使用Git生成patch和应用patch
- 使用git-am合并git format-patch生成的一系列的patch