Forrest logo
back to the git tool

git-stash:tldr:3400e

git-stash: List all stashes (shows stash name, related branch and message).
$ git stash list
try on your machine

The command git stash list is used in Git to display a list of all stashes that have been created in the current repository.

When you are working on a branch in Git, and you have made some changes that you are not yet ready to commit, you can use the git stash command to save those changes temporarily. This creates a "stash" that you can later apply to your working branch or another branch.

The git stash list command lists all the stashes that you have created. It provides information such as the stash reference (a unique identifier for each stash), the branch name or commit where the stash was created, and a description if provided during the stash creation.

Here is an example of how the git stash list command might look like:

$ git stash list
stash@{0}: On feature/branch-1: WIP: Add new feature
stash@{1}: On master: WIP: Bug-fix

In this example, two stashes have been created. The first stash (stash@{0}) was created on the feature/branch-1 branch with the description "WIP: Add new feature". The second stash (stash@{1}) was created on the master branch with the description "WIP: Bug-fix".

Knowing the stash references can be useful when you want to apply or delete a specific stash.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the git tool