Wednesday, May 19, 2021

GIT Basics- Managing multiple stashes

1. Here we make changes to different multiple, 3 files

2. stash them separately - 3 stash

3. apply one stash from them - middle one or 2

4. drop other stashes


git status -> clean, on master branch:

mate simple.html

git stash save "simple changes"

mate index.html

git stash save "index changes"

mate man.txt

git stash save "man changes"


List all stash

git stash list

-------------------------

stash@{0}: On master : man changes

stash@{1}: On master : index changes

stash@{2}: On master : simple changes


Apply middle stash - reflog syntax

you can see the content with

git stash show stash@{1}


git status -> clean

re apply 

git stash apply stash@{1} -> this will show status also

modified: index.html


if you list, still have 3 items

git stash list

git stash drop stash@{1}


git stash list --> will have only 2 items 

git stash clear --> clear all stash items

git stash list   --> no result, empty

No comments:

Post a Comment