zoukankan      html  css  js  c++  java
  • VS2015中使用Git遇到问题 Cannot do push / pull in git

    I have made a lot of changes, when I am trying to push them - I am getting the next error:

    You cannot push branch master to remote origin because there are new commits in the remote repository’s branch. Pushing this branch would result in a non-fast-forward update on the branch in the remote repository.

    When I am trying to pull the changes I get:

    Cannot pull because there are uncommitted changes. Commit or undo your changes before pulling again. See the Output window for details.

    I dont have any uncommitted changes...

    I am stock from both ways and dont know how solve this issue.

    Try this procedure to solve:

    stash your local commits Try to get the changes and then push:

    $ git stash

    pull from master:

    $ git pull 

    get your local changes back after pulling the master branch

    $ git stash pop

    commit your local changes

    $ git commit

    push

    $ git push

     

  • 相关阅读:
    JS中声明变量的细节问题
    你不知道的var! 细节
    读书笔记:对象的属性
    手写new操作符
    slice
    全相等函数 isEqual
    几个面试题
    全相等函数
    剑指 Offer 29. 顺时针打印矩阵
    剑指 Offer 28. 对称的二叉树
  • 原文地址:https://www.cnblogs.com/wphl-27/p/6291719.html
Copyright © 2011-2022 走看看