本文参考:http://stackoverflow.com/questions/19864934/git-your-branch-and-origin-master-have-diverged-how-to-throw-away-local-com

如果不需要保留本地的修改,只要执行下面两步:

git fetch origin
git reset --hard origin/master

[小技巧] git: Your branch and 'origin/master' have diverged的更多相关文章

  1. git: Your branch and 'origin/master' have diverged

    git: Your branch and 'origin/master' have diverged - how to throw away local commits? - Stack Overfl ...

  2. Your branch and 'origin/master' have diverged, and have 1 and 1 different commits each, respectively

    On branch master Your branch and 'origin/master' have diverged, and have 1 and 1 different commits e ...

  3. git出现Your branch and 'origin/master' have diverged解决方法

    如果不需要保留本地的修改,只要执行下面两步:git fetch origingit reset --hard origin/master 当我们在本地提交到远程仓库的时候,如果遇到上述问题,我们可以首 ...

  4. Your branch and 'origin/master' have diverged

    git fetch origin git reset --hard origin/master

  5. 新建本地仓库,同步远程仓场景,出现git branch --set-upstream-to=origin/master master 解决方法

    1.本地创建一个本地仓库 2.关联远程端:git remote add origin git@github.com:用户名/远程库名.git3.同步远程仓库到本地git pull这个时候会报错If y ...

  6. 【IDEA】 Can't Update No tracked branch configured for branch master or the branch doesn't exist. To make your branch track a remote branch call, for example, git branch --set-upstream-to origin/master

    IDEA点击GIT更新按钮时,报错如下: Can't UpdateNo tracked branch configured for branch master or the branch doesn' ...

  7. git 强制提交 & 覆盖 origin/master

    git 强制提交 & 覆盖 origin/master git 强制提交本地分支覆盖远程分支 # git push origin 分支名 --force # local $ git push ...

  8. IDEA使用Git出现push to origin/master was rejected错误解决方案

    在IDEA中配置码云的URL,如下图 切换到自己项目所在的目录,右键选择GIT BASH Here 在terminl窗口中依次输入命令: git pull git pull origin master ...

  9. git push origin master出错:error: failed to push some refs to

    1.输入git push origin master 出错:error: failed to push some refs to 那是因为本地没有update到最新版本的项目(git上有README. ...

随机推荐

  1. M面经Prepare: Find integer Average of 2 integers.

    The definition of integer average is the highest smaller integer if average is floating point number ...

  2. Aspectj是什么

    转载自:http://www.cnblogs.com/sunwke/articles/2568875.html 网上出现了很多讲解 AspectJ 的资料,但大多是从讲解 AspectJ 语法开始,然 ...

  3. BCB 多线程的同步与协调

    多线程编程是提高系统资源利用率的一种常见方式.它占用的资源更小,启动更快,还可以实现在后台运行一些需时较长的操作.[喝小酒的网摘]http://blog.hehehehehe.cn/a/8498.ht ...

  4. mysql之消息队列

    消息队列:在消息的传输过程中保存消息的容器. 消息队列管理器在将消息从它的源中继到它的目标时充当中间人.队列的主要目的是提供路由并保证消息的传递:如果发送消息时接收者不可用,消息队列会保留消息,直到可 ...

  5. 在 msbuild 生成时,每次都生成很多css,js,img 文件,如果不想每次编译都有这些需要这样配置

    在 msbuild 不想生成一大堆文件,可以在 Web 项目的csproj 文件里,注释掉这一串. <!--<Import Project="$(VSToolsPath)\Web ...

  6. EBS fnd_global.apps_initialize

    原型:fnd_global.apps_initialize(user_ID,                                             Responsibility_id ...

  7. [php笔记]项目开发五个阶段/雇员管理系统

    zend 公司,管理PHP版本的升级. 功能强大, 官方推荐. (开发一个PHP项目) 软件开发的五个阶段. 1.创建一个项目(工程)2.设置该项目的路径3.创建一个文件test.php ***使用Z ...

  8. [sinatra] Sinatra再入门

    原文URL:http://www.rubycc.com/bbs/topic_detail/86 1.基础代码app.rb require 'rubygems' require 'sinatra/bas ...

  9. Android SDK Manager更新报错

    错误log: Fetching https://dl-ssl.google.com/android/repository/addons_list-.xml Fetched Add-ons List s ...

  10. QTP11.00安装+破解详细教程

    一.      安装过程 首先双击setup.exe文件,选择“QuickTest Professional安装程序” 此时会查看你机子上面是否有QTP需要,但是机子上没有的组件, 跟着先安装这两个组 ...