発生内容
$ git stash apply stash@{0}
error: unknown switch `e'
usage: git stash apply [--index] [-q | --quiet] [<stash>]
-q, --[no-]quiet be quiet, only report errors
--[no-]index attempt to recreate the index
発生環境
- Windows 11
- VSCode May 2025 (version 1.101.2)
- git version 2.45.1.windows.1
対策
stash名を上手く認識できていないようなので、シングルクオートで囲ってやるとよい
$ git stash apply 'stash@{0}'
On branch dev
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: src/App.svelte
modified: src/components/Selector.svelte
no changes added to commit (use "git add" and/or "git commit -a")
感想
かなり盲点。stash名を上手く認識できないのは他の操作でも発生するらしい。