GitLab Documentation

Git Stash

We use git stash to store our changes when they are not ready to be committed and we need to change to a different branch.

git stash list
# or for more information (log methods)
git stash list --stat
# drop top stash
git stash drop
# or
git stash drop <name>
# to clear all history we can use
git stash clear

  git stash pop

Git Stash

  1. Modify a file
  2. Stage file
  3. Stash it
  4. View our stash list
  5. Confirm no pending changes through status
  6. Apply with pop
  7. View list to confirm changes


# Modify edit_this_file.rb file
git add .

git stash save "Saving changes from edit this file"

git stash list
git status

git stash pop
git stash list
git status