git 生成patch并打入主干
来源:互联网 发布:js 鼠标滑过div手型 编辑:程序博客网 时间:2024/05/29 11:46
1.生成Patch
a.查看日志信息,选择要打补丁的版本 git log
b.git format-patch 5fbfa380424a0e048f2cd935a5440151fa1eb6a5 生成补丁 (某次提交之后的所有提交打成一个patch)
format-patch 参数
当前分支所有超前master的提交:
git format-patch -M master
某次提交以后的所有patch:
git format-patch 4e16 --4e16指的是commit名
从根到指定提交的所有patch:
git format-patch --root 4e16
某两次提交之间的所有patch:
git format-patch 365a..4e16 --365a和4e16分别对应两次提交的名称
某次提交(含)之前的几次提交:
git format-patch –n 07fe --n指patch数,07fe对应提交的名称
故,单次提交即为:
git format-patch -1 07fe
c.切换分支 git branch 查看分支情况 git checkout master 切换到主干分支
d.执行git am 0001-test-patch-S6.patch 想要将补丁打入master分支 由于存在冲突 不能正常打入
e.git apply 0001-test-patch-S6.patch --reject生成冲突文件对比解决冲突
f. git add src/main/resources/zConfig.properties 将最终版本文件添加进patch
g. git am --resolved 解决冲突 git commit 本地提交
h.最终提交 git push
注意:
尽量在每次打补丁时提前 git pull 防止冲突
阅读全文
0 0
- git 生成patch并打入主干
- 如何使用git 生成patch 和打入patch
- 如何使用git 生成patch 和打入patch
- Git 生成并应用 patch
- git 生成patch 并应用补丁
- git diff 两个分支的差别,并生成patch
- git 生成patch 方法
- git生成patch
- git patch生成方法
- 用git生成patch
- git生成patch文件
- git 生成patch
- git format-patch origin 生成patch
- git 生成patch和使用patch
- git生成patch以及am patch
- 使用Git生成patch和应用patch
- Git生成patch和合入patch
- 使用Git生成patch和应用patch
- html的超链接,图像以及列表标签
- Jzoj4895 三部曲
- 蓝牙5.0发布(新特性速览)
- Struts2和Spring的整合代码截图
- 画家与黑客(语录)
- git 生成patch并打入主干
- python索引问题
- Context应用
- tomcat 启动项目时出现 ZipException: error in opening zip file
- 为什么那么多人都选择通过培训来学习Java?
- 整合hibernate与JPA
- git error Large files detected解决办法
- Python web 框架 Flask 入门 macOS 下实践记录
- kafka学习(1)