Git Tip: git stash

Using the “git stash” command is helpful if you need to change branches and have some uncommitted changes you want to preserve.
It saves the changes in a ‘buffer’ where you can access the stashed changes in the future.

To stash uncommitted changes

Add files to the stage

git add .

Stash the changes

git stash

See the a list of stashed changes:

git stash list

Do other work, switch branches or whatever you gotta do. Then whenever you are ready to get back to your stashed work simple runt he command See the git-scm book for more detailed usage and dealing with multiple stashes.:

git stash apply

Source: git-scm book

Leave a Reply

Your email address will not be published. Required fields are marked *