Home Navigation

Tuesday 1 September 2020

Git stash commands

#git stash save “Your stash message” //Git stash with message

Stashing untracked files
#git stash save -u
or
#git stash save --include-untracked

view the list of stashes you made at any time.
#git stash list

#git stash apply // applies the latest stash stash@{0}

if you want some other stash to apply
#git stash apply stash@{2} // third one

#git stash pop   // applies the latest stash stash@{0} and removes it
#git stash pop stash@{1} // applies the second one and removes it


#git stash show // summary of stash diff of the stash content
#git stash show -p // shows full diff of the stash content
#git stash show stash@{1} // specific stash diff and contents

#git stash branch <name> // creates a new branch with latest stash and removes it
#git stash branch <name> stash@{1} // if you want to specify a stash id

#git stash clear // deletes all the stashes made in the repo
#git stash drop stash@{2} // specify id to delete the stash
 

No comments:

Post a Comment