泰州网站模板,最经典最常用的网络营销方法,天元建设集团有限公司张桂玉丑闻,本地打开WordPress慢没有排版#xff0c;但是干货
因为项目要求#xff0c;所以使用rebase指令
我使用的是rebase 的分支变基的功能
情景描述#xff1a; 一共有两个分支#xff1a;master owner 我在owner分枝上开发#xff0c;有好多次commit master上也有同事在正常commit#xff0c; …没有排版但是干货
因为项目要求所以使用rebase指令
我使用的是rebase 的分支变基的功能
情景描述 一共有两个分支master owner 我在owner分枝上开发有好多次commit master上也有同事在正常commit 现在我要将master分支 合并到我的owner分枝上首先确定不能使用merge
具体操作
我的owner分支是干净的没有未commit以及未push的数据如果有 stash起来git checkout mastergit pull origin mastergit checkout ownergit rebase master
如果存在冲突修改冲突修改完成之后执行 git add . 在执行git rebase --continue 继续进行rebase操作 直到结束
git push git pull git log 查看一下
在创建一个新的应用场景你可能需要用
有分支A和分支B 分支A 上有commit1commit2commit3 分支B上有commit4commit5commit6commit7commit8 现在我想将分支B上的commit5commit6 rebase到分支A操作如下 创建一个临时分支保存要 rebase 的 commit创建一个临时分支来保存 commit5 和 commit6以便我们可以轻松地将它们 rebase 到分支 A。 agit checkout B bgit checkout -b temp-brach 重置临时分支到 commit4commit5 之前使用 git reset 命令将临时分支重置到 commit4。commitid 可以使用 git log 获取 agit reset --hard commit4-hash 检查并保存 commit5 和 commit6使用cherry-pick 命令将 commit5 和 commit6 添加到临时分支 a git cherry-pick commit5-hash b git cherry-pick commit6-hash 重点切换到分支 A 并将临时分支的修改 rebase 到分支 A 上 agit checkout A bgit rebase temp-branch 如果存在冲突修改冲突修改完成之后执行 git add . 在执行git rebase --continue 继续进行rebase操作 直到结束如果想直接结束不进行rebase 就执行 git rebase --abort 删除临时分支 agit branch -d temp-branch 如此操作就可以将分支B上的commit5commit6 rebase到分支A