1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

git stashしたら、error: unknown switch `e'と怒られた時の対処法

Posted at

発生内容

$ 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名を上手く認識できないのは他の操作でも発生するらしい。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?