git stash single file

Snippet

If you want to stash a single file, and not the whole change set. use --

See also View Git Stash Contents Without Applying to Codebase

Of note, this will stash staged changes, too, even if you dno't specify them in the --

$ git stash -- filename.ext

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.