如何使用git 生成patch
2015-12-17 17:31
405 查看
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项目的要目录下。
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项目的要目录下。
相关文章推荐
- wireshark 实用过滤表达式(针对ip、协议、端口、长度和内容)
- android IPC通信(中)-ContentProvider&&Socket
- SWIG,C/C++类库与Java,Python等泛高阶语言的万能粘合剂
- fastDFS errcode:9 path:Bad file descriptor errcode:22 path:Invalid argument
- CSS的base文件常用代码
- sql server 常用脚本(日常查询所需)
- 单片机之头疼问题
- android IPC通信(下)-AIDL
- Hadoop关键任务Job资源隔离方案
- 5-2 UVA 1594 Ducci Sequence (Ducci序列)
- Python基础教程 第6章: 抽象(函数) 学习笔记
- 05-时钟效果
- WAF 与 RASP 的安装使用大比拼!
- 强大的分布式消息中间件――kafka
- <s:hidden>标签的使用
- redis 学习手册之事务 transaction 操作
- Android知识点记录:七牛Android SDK调试整理
- Oops信息及栈回溯
- hdu 1015 Safecracker【dfs 排列组合】
- 用JAVA代码获取Weblogic配置的JNDI 数据源连接