方式1

当前的开发分支:feature-knowledge-api-ghh,主线分支:dev-sir-cloudsoc

① 切换到主线分支dev-sir-cloudsoc:

git checkout dev-sir-cloudsoc

② 拉取远程主线分支dev-sir-cloudsoc到本地的主线分支dev-sir-cloudsoc :

 git pull --rebase

③ 切回到当前的开发分支feature-knowledge-api-ghh:

 git checkout feature-knowledge-api-ghh

④ 拉取远程分支dev-sir-cloudsoc 的代码:

 git rebase dev-sir-cloudsoc

⑤ 将当前开发分支分支feature-knowledge-api-ghh提交到远程分支feature-knowledge-api-ghh:

 git push origin feature-knowledge-api-ghh -f

完整流程:

  683  git checkout feature-containerization
  684  git pull --rebase
  685  git checkout feature-containerization-ghh
  686  git rebase feature-containerization
  687  git push origin feature-containerization-ghh -f

方式2

① 切换到远程分支:dev-sir-cloudsc,然后查看远程的提交记录

git checkout dev-sir-cloudsoc
git log --oneline --graph

② 将远程拉取的代码与本地分支合并:

git rebase dev-sir-cloudsoc feature-knowledge-api-ghh

③ 如果出现冲突,解决冲突

④ 解决完冲突,然后继续合并:

git rebase --continue

⑤ 将代码提交到远程:

 git push origin feature-knowledge-api-ghh -f
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐