Tuesday, May 31, 2022

git stash


git stash

Stashing takes the dirty state of your working directory — that is, your modified tracked files and staged changes — and saves it on a stack of unfinished changes that you can reapply at any time (even on a different branch)

 # modify the file (Not commited)
      git stash save "some message"
 #list all the stash changes
     git stash list
 #revert the change in git repo
     git stash apply  stash@{0}
 # revert and remove it from git list
     git stash pop
 #drop the stash changes 
      git stash drop  stash@{0}
 #drop all stash changes
      git stash clear


Post a Comment