Git Stash

作者: 薛路 | 来源:发表于2017-01-04 10:48 被阅读0次
    • save stash

      $ git stash
      
    • list stash

      $ git stash list
      
    • apply stash

      #apply the latest stash
      $ git stash apply
      
      #apply older stash
      $ git stash apply stash@{2}
      
    • pop stash

      #apply the lastest stash and drop it
      $ git stash pop
      
    • drop stash

      $ git stash drop stash@{0}
      
    • Creative Stashing

      #not stash anything that you've already stages
      $ git stash --keep-index
      
      #also stash any untracked files
      $ git stash -u
      
      #prompt you interactively which of the changes you would like to stash and which you would like to keep in your working directory
      $ git stash --patch
      
      #creates a new branch for you, checks out the commit you were on when you stashed your work, reapplies your work there, and then drops the stash if it applies successfully
      $ git stash branch testchanges
      

    相关文章

      网友评论

          本文标题:Git Stash

          本文链接:https://www.haomeiwen.com/subject/hfsovttx.html