[Git] stash に名前を付けて保存する
作成日: 2026年09月22日
git stash push の -m オプションを使用すると、stash に分かりやすいメッセージを付けて保存できます。
git stash push -m "update config"
実行結果は下記のとおりです。
Saved working directory and index state On main: update config
保存した stash は git stash list で確認できます。
git stash list
実行結果は下記のとおりです。
stash@{0}: On main: update config
-m で付けたメッセージは stash の一覧に表示されるため、複数の stash を使い分けるときに内容を判別しやすくなります。