stashing

What is git stashing?

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).

In simple words, all uncommited changes can be temporary saved, and be applied to the same or another branch later on.

How to use git stashing?

#----# how to use git stashing #----#
###### when you have made changes that you want to stash
git stash [name] # name is optional, can

##### list your stashes #####
git stash list

##### apply your stashes #####
git stash apply [index] # index can be found in the command git stash list

##### drop a stash #####
git stash pop [index] # index can be found in the command git stash list, safest method
git stash drop [index] # index can be found in the command git stash list, drops it right away

##### these stashes can be carried over branches 

Last updated