Forrest logo
back to the git tool

git-stash:tldr:3b89f

git-stash: Stash current changes, except new (untracked) files.
$ git stash push -m ${optional_stash_message}
try on your machine

The git stash push command is used to save changes in your working directory and index, so that you can switch to a different branch or checkout a specific commit without committing your changes. It allows you to temporarily save your changes and reapply them later, as if you never switched away from the branch.

The -m flag is used to provide an optional stash message. This message is a brief description or note that you can attach to the stash, so you can easily identify it later.

So, the command "git stash push -m ${optional_stash_message}" is used to create a stash with an optional message. You replace ${optional_stash_message} with your desired message enclosed in quotes. For example:

git stash push -m "Fix bug in feature XYZ"

This command would create a stash with the message "Fix bug in feature XYZ".

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