zoukankan      html  css  js  c++  java
  • git stash错误小记

    git出错小记

     

    想要push代码,我们经常这样做。

     

    1.查看状态 git status

     

    2.隐藏本地编辑的新内容 git stash

     

    3.拉远程的代码 git pull

    这一步操作有的时候会报错,没有仔细阅读报错内容的同学,

    以为git pull失败了,

    失败的原因是因为刚才的git stash没成功。

     

    为了弥补错误,马上又进行下一步操作:

    4.git stash

     

    此时问题就产生了,其实刚才的所有操作都成功了,并且我们pull

    下了代码,但是我们stash了两次。

     

    此时再想stash apply 已经不能恢复代码,因为种种原因会提示

    文件冲突之类的。

     

    此时直接stash list 里面找到第2步的stash指针,想要通过

    git stash apply stash@{id}也是行不通的。

     

    #### 解决办法

     

    1.把版本会退到上一次更新代码

    也就是上面第2git stash的状态。

    git reset --hard {commit id};

     

    2.此时再利用stash list

     

    3.git stash apply stash@{id}

     

  • 相关阅读:
    Python三维绘图--Matplotlib colorbar生成
    Python三维绘图--Matplotlib
    VIM剪切板的使用
    三维点云网络PointNet——模型及代码分析
    ECCV2018--点云匹配
    hdu 1905 小数化分数2
    hdu 1755 A Number Puzzle
    hdu 1796 How many integers can you find
    hdu 1452 Happy 2004
    hdu 2837 Calculation
  • 原文地址:https://www.cnblogs.com/serena25/p/7110816.html
Copyright © 2011-2022 走看看