zoukankan      html  css  js  c++  java
  • git stash的用法

    使用git stash

    git stash的使用场景是这样的: 当你正在你的分支下进行开发时,这时候你可能需要切换到你的另一个分支去,你可能要pull新的代码下来,但是你又不想添加无用的commit。这个时候你就要用到了git stash, 它的作用是保存当前正在进行的工作,它会将当前工作压入栈中。

    基本使用

    git stash
    // do other things
    git pop
    
    // or you can do this
    git stash save "I just want to save this work and fix my other bug"
    
    // list my stash stacks
    git stash list
    
    // or maybe you will see this
    stash@{0}: On master: I want to save my work and fix my bug
    stash@{1}: On master: save 1
    
    // 0 is the top of stack
    
    // and you will do this to get 
    git stash apply stash@{1}
    
    // or you will do this to get the top of stack
    git pop
    
    // maybe you need this to clear stack
    git stash clear 
    
    // and last, you maybe need this
    git stash --help
    
  • 相关阅读:
    SpringMVC
    SpringMVC
    SpringMVC
    Spring
    Spring
    值类型和引用类型
    判断字符串的开头和结尾
    二分法(课后)
    验证码
    从1-36中随机出6个不相等的数
  • 原文地址:https://www.cnblogs.com/yzfdjzwl/p/7010398.html
Copyright © 2011-2022 走看看