git - 如何强制分支更新?
问题描述
这是一个关于 git branch 和 git pull 的问题。
目前的情况如下。
已在远程存储库中创建了“发布”分支。(偏僻的)
在本地拉出“发布”分支。(当地的)
从远程存储库中删除了“发布”分支。本地还有一个“发布”分支。(偏僻的)
已在具有新功能的远程存储库中创建了一个“发布”分支。(偏僻的)
我希望使用远程存储库中的新“发布”分支更新本地“发布”分支。(当地的)
git pull 不起作用,因为分支名称相同,但分支的创建方式不同。
有什么好办法?
请给我一些建议。
解决方案
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>
推荐阅读
- node.js - 无法在节点 js REST API 中使用猫鼬保存超过 2 个属性
- javascript - 在 onchange 事件上添加变量值
- python - 如何在python docx中垂直写表
- c++ - 学习openCV,获取LNK2019(未解析的外部符号)
- kubernetes - 部署 YAML 文件时出现 Kubernetes 错误
- laravel - laravel 5.6 将散列密码转换为普通密码?
- saml-2.0 - CAS 6.1.3 SAML 问题
- python - 如何从 Python 的父目录中的包中导入模块?
- reactjs - 尝试在 Firebase 上实现云功能,但未定义变量出现错误
- python - 将excel公式保存在DataFrame中,然后写入excel