問題一覧に戻る
中級スタッシュ
問題39: git stash list - スタッシュスタックの表示
git stash listコマンドでスタッシュスタックに保存されているすべてのスタッシュを表示する方法を学びます。このコマンドは各スタッシュのインデックス番号、ブランチ名、コミットメッセージを表示し、識別しやすくします。
# 複数のスタッシュを作成
echo "First work" > work1.txt
git add work1.txt
git stash push -m "First stash"
echo "Second work" > work2.txt
git add work2.txt
git stash push -m "Second stash"
# すべてのスタッシュを一覧表示
git stash