Introduction
This guide demonstrates how to add files to a stash using Lazygit. Stashing is useful for temporarily setting aside changes in your working directory.
Lazygit
-
Press
2
to switch to the 2. Files panel. -
Navigate to the desired files using
↓
/↑
keys or asingle click
. -
Once you’ve highlighted a file:
- Press the
s
key to mark individual files for stashing.
- Press the
-
Observe the changes in the Files window as you select files for stashing.
-
For regular stashing, press
s
. However, for more options:- Press
Shift+S
to access the Stash Options menu.

- Press
-
In the Stash Options menu:
- Choose “stash staged changes” and press
Enter
. - Enter a message for your stash when prompted.

- Choose “stash staged changes” and press
-
Confirm the stash is created:
- Look at the bottom-left window to see your new stash entry.

Basic Terminal
To perform a similar action in the terminal:
-
Stage the files you want to stash:
git add <file1> <file2> ...
-
Stash the staged changes with a message:
git stash push -m "Your stash message"
-
To confirm the stash was created:
git stash list
This process in the terminal provides a straightforward way to handle stashing, complementing the Lazygit approach.