首页 > 解决方案 > 如何强制分支更新?

问题描述

这是一个关于 git branch 和 git pull 的问题。

目前的情况如下。

  1. 已在远程存储库中创建了“发布”分支。(偏僻的)

  2. 在本地拉出“发布”分支。(当地的)

  3. 从远程存储库中删除了“发布”分支。本地还有一个“发布”分支。(偏僻的)

  4. 已在具有新功能的远程存储库中创建了一个“发布”分支。(偏僻的)

  5. 我希望使用远程存储库中的新“发布”分支更新本地“发布”分支。(当地的)

git pull 不起作用,因为分支名称相同,但分支的创建方式不同。

有什么好办法?

请给我一些建议。

标签: gitgithub

解决方案


just fetch your remote release branch to your local release branch.
git checkout master
git fetch <your-remote-repo> <your-remote-release-branch>:<your-local-release-branch>
git checkout <your-local-release-branch>


推荐阅读