[Git]将remote branch强制更新到local branch
来源:互联网 发布:淘宝生意参谋是什么 编辑:程序博客网 时间:2024/06/05 17:03
问题描述
本地branch状态与远程branch状态不一致,并且有conflicts。此时如果想将本地branch更新同远程branch一样的状态,直接进行pull,会有很多conflicts。
解决方法
1. 尝试将本地分支回退到一个可以fast-forward的commit,然后进行pull操作。
git reset --hard {some_commit}
git pull origin {local_branch_name}
或者:
2. 从远程repository fetch,然后强制更新local branch.
git fetch --all
git reset --hard origin/{remote_branch_name}
- [Git]将remote branch强制更新到local branch
- Git: Delete a branch (local or remote)
- Checkout remote Git branch
- git branch&&rebase&&remote
- [Git]setting an existed local branch to track a remote branch
- git中local branch追踪remote branch http://www.cnblogs.com/freefish12/p/5819134.html
- Git notes about remote branch
- git 删除 remote branch索引
- Git Push create remote branch
- 使用git创建local branch并push到远程
- git branch -r view the newly created remote branch
- How to Push a New Local Branch to a Remote Git Repository
- Git remote branch 远程分支管理
- git pull error (no local branch)
- Android Studio中Git更新本地的远程(remote)branch列表?
- git branch
- git branch
- git branch
- FusionCharts Free中文开发指南 第十章--FCF中的下钻
- PLAY2.0框架快速入门
- UITableView实现双击事件的方法
- c++ primer 13.4
- java中this的使用
- [Git]将remote branch强制更新到local branch
- 主机字节序与网络字节序
- R文件不会自动更改问题的解决
- 登陆界面测试
- 一鸣演讲训练-30天
- FusionCharts Free中文开发指南 第十一章--FCF中的基本数字格式
- 用好微软MSDaRT 完成win7系统诊断修复
- 自用php一句话木马绝对免杀没有任何关键字
- FusionCharts Free中文开发指南 第十二章--FCF中的特殊字符