码迷,mamicode.com
首页 > 其他好文 > 详细

如何使用git 生成patch

时间:2014-05-15 02:59:38      阅读:386      评论:0      收藏:0      [点我收藏+]

标签:git

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

如何使用git 生成patch,布布扣,bubuko.com

如何使用git 生成patch

标签:git

原文地址:http://blog.csdn.net/liuxd3000/article/details/25798065

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!