(1)方法1:git fetch origin

(2)方法2(代码还需要):git push origin

(3)方法3 (代码不需要):git reset --hard origin/$branch

  参考:

  https://blog.csdn.net/Thousa_Ho/article/details/73350703

  https://stackoverflow.com/questions/16288176/your-branch-is-ahead-of-origin-master-by-3-commits

  可以先执行下git  diff $branch origin/$branch 看下差异

【备注,先git log 看看还有没有没有push 的commit的,如果没有,就用git reset --hard origin/$branch强制覆盖成和远程仓库一样,如果有的话,就先push】

(4) git pull --rebase

(5)git pull origin cherryPick

  参考:https://blog.csdn.net/u010383937/article/details/72901675

Git Your branch is ahead of 'origin/master' by X commits解决方法的更多相关文章

  1. git status message - Your branch is ahead of origin/master by X commits

    git reset --hard origin/master git status FAQ: When I issue the "git status" command, I se ...

  2. Your branch is ahead of 'origin/master' by 21 commits.

    当切换到主分支后,准备 git pull 拉取远程 master 分支时,提示本地主分支显示有 21 个commits 问题原因: 因为你修改了 local master 本地的主分支,可以选择以下方 ...

  3. Your branch is ahead of 'origin/master' by 2 commits.

    遇到这种问题,表示在你之前已经有2个commit而没有push到远程分支上,所以需要先git push origin **将本地分支提到远程仓库.也可以直接git reset --hard HEAD~ ...

  4. Git报错:Your branch is ahead of 'origin/master' by 1 commit

    .    commit之后,用git status,打印信息为: # On branch master # Your branch is ahead of 'origin/master' by 1 c ...

  5. Git - git push origin master 报错的解决方法

    亲测实用,转载保存,原文地址:https://blog.csdn.net/kangvcar/article/details/72773904 错误提示如下: [root@linux1 php]# gi ...

  6. 提交代码出现 Push to origin/master was rejected 错误解决方法

    转至博客:http://www.xtyos.cn/archives/qt-1-index 为什么会出现这样的问题 一般发生在 GitHub 或 码云 刚刚创建仓库第一次pull的时候,两个仓库的差别非 ...

  7. Your branch is ahead of 'origin/master' by 1 commit.

    git reset HEAD^ --soft git reset HEAD^ --hard --soft 表示保留当前commit,重新commit --hard 表示丢弃当前add,重新add.co ...

  8. git pull 然后 ahead of origin/master * commit 消失

    本来显示 your branch is ahead origin/master * commit后来也许在master merge 这个分支后, 然后git pull, 就显示Your branch ...

  9. git问题--Push rejected: Push to origin/master was rejected

    解决git问题 Push rejected: Push to origin/master was rejected 意思是git拒绝合并两个不相干的东西 此时你需要在打开Git Bash,然后进入相应 ...

随机推荐

  1. 10.14 预订会议室的小Demo

    2018-10-14 17:12:32 越努力,越幸运.永远不要高估自己! 网上修改一下博客网站样式,做个仿qq空间的! 放上github连接 :https://github.com/TrueNewB ...

  2. CentOS开机自启动/etc/rc.local不执行的解决办法

    放置在开机自启动里面没有自动启动 查看文件/etc/rc.local发现是一个软连接 修改源文件的执行权限即可 chmod 755 /etc/rc.d/rc.local 查看日志可以看到开机自启动过程 ...

  3. java.util.ResourceBundle学习笔记

    一.初次使用,从网上查的资料,知识点参考JDK API和博文http://lavasoft.blog.51cto.com/62575/184605(该博主写的清晰易懂) 二.自己在程序中的具体应用: ...

  4. 泡泡一分钟:A Multi-Position Joint Particle Filtering Method for Vehicle Localization in Urban Area

    A Multi-Position Joint Particle Filtering Method for Vehicle Localization in Urban Area 城市车辆定位的多位置联合 ...

  5. [No000013C]B树、B-树、B+树、B*树

    B树 即二叉搜索树: 1.所有非叶子结点至多拥有两个儿子(Left和Right): 2.所有结点存储一个关键字: 3.非叶子结点的左指针指向小于其关键字的子树,右指针指向大于其关键字的子树: 如: B ...

  6. 使用qemu模拟调试内核和debian根文件系统

      开发环境:Ubuntu 14.04.3 LTS  64bit sudo debootstrap jessie /mnt/jessie http://mirrors.163.com/debian 在 ...

  7. 转:servlet的url-pattern匹配规则详细描述

    原文地址:servlet的url-pattern匹配规则详细描述   原文写的很详细 另外可以参考一下:Web.xml中设置Servlet和Filter时的url-pattern匹配规则 一.概述 在 ...

  8. 2018/03/07 每日一个Linux命令 之 cat

    每日一个Linux命令 2018-03-07 Linux 命令 cat cat [-参数] fileName 在之前的Linux使用中 cat 命令一直作为文本输出指令来使用,很少可以深入学习的该命令 ...

  9. tensorflow入门笔记(四) tf.summary 模块

    模块内的函数: tf.summary.audio(name, tensor, sample_rate, max_outputs=3, collections=None, family=None) 输出 ...

  10. pyinstaller-打包python程序为exe文件

    pyinstaller ---转载文章 视频:https://www.bilibili.com/video/av21670971/ PyInstaller可以用来打包python应用程序,打包完的程序 ...