Difference between stash vs stage files in GIT

1.- More than “save” your files, is act as Git expect to according their flow. (Advice, Git knows 🙂 )

2.- Stash will move your modified files into a stack. So, later in the same or in another branch, you will be able to bring them back and see those modifications in your project.

Stage is the step before to make a commit, you add modified files to “Staged files” to create your next commit.

Now, you stash your files with

$git stash

and you add files (stage) with

$git add

Now, why is better stash your changes than staging them?
Maybe this part of the documentation can solve your doubts:
From documentation:


Often, when you’ve been working on part of your project, things are in
a messy state and you want to switch branches for a bit to work on
something else. The problem is, you don’t want to do a commit of
half-done work just so you can get back to this point later. The
answer to this issue is the git stash command.

See the links below :

  • Git Stashing Doc
  • Git Add Doc
  • Staging example
  • Git Basics

Leave a Comment