Introduction
This tutorial guides you through the process of deleting a stash in Lazygit. This action is useful when you want to clean up your stash list by removing entries that are no longer needed.
Lazygit
-
Open Lazygit and navigate to the 5. Stash panel.
-
Use the
↓/↑keys to browse through your stash entries. -
Select the stash entry you want to delete.
-
Press the
dkey to initiate the deletion of the selected stash. -
A confirmation prompt will appear. Press
enterto confirm the deletion.- Add#screenshot showing the stash selection and deletion confirmation prompt.
-
Upon confirmation, the selected stash will be permanently deleted from the stash list.
- Add#screenshot of the stash list after deletion.
Basic Terminal
To delete a stash entry in the terminal:
-
List your stashes to find the one you want to delete:
git stash list -
Delete the specific stash (replace
stash@{n}with the correct stash identifier):git stash drop stash@{n} -
Verify the deletion:
- Run
git stash listagain to ensure the stash has been removed.
- Run
This terminal method offers a direct way to manage your stash entries, complementing the Lazygit approach.