举例------主分支:hospital1.5.0,开发分支:hospital1.5.0_dev
开发分支:hospital1.5.0_dev上
- git stash //暂存代码
- git checkout hospital1.5.0 //切到主分支
主分支:hospital1.5.0上
- git pull --rebase //拉取最新代码
- git checkout hospital1.5.0——dev //切到开发分支
开发分支:hospital1.5.0_swl上
-
git rebase hospital1.5.0 //将hospital1.5.0合并到hospital1.5.0——dev
-
git stash pop //应用暂存代码
-
若应用暂存存在冲突
找对应人核对保留的内容,解决完冲突后执行下面操作 -
git commit -a -m "提交说明" //代码移到仓库区
-
git checkout hospital1.5.0 //切到主分支
-
主分支:hospital1.5.0上
-
git pull --rebase //拉取最新代码
-
git checkout hospital1.5.0——dev //切到开发分支
-
git rebase hospital1.5.0 //如果hospital1.5.0没有新的提交,这步可以不做
-
git push //推送到远程仓库 (如是仅dist打包文件冲突,直接删除dist文件,重新打包后提交)
-
若应用暂存不存在冲突,直接执行下面操作
-
git add . //代码移到暂存区
-
git commit -a -m "提交说明" //代码移到仓库区
-
git pull --rebase //拉取最新代码,这步可以不做
-
git push //推送到远程仓库
解决提交说明导致的push失败步骤
- git rebase -i 版本号
- 输入i进入编辑模式,将pick改成edit
- esc退出编辑模式
- :wq保存
- git commit --amend
- git rebase --continue