Skip to content

VS Code should warn before stashing files with unsaved changes #87938

@jessdwitch

Description

@jessdwitch

Issue Type: Bug

  1. Make changes to a source-controlled file
  2. Save changes
  3. Make additional changes to the file
  4. Without saving the additional changes, stash changes using the ... menu in SOURCE CONTROL: GIT in VS Code or by right-clicking the file in the list of files changed since last commit.

You will stash the version of the file saved in step 2. This might be what you want, but in the case of commits VS Code will warn you, and give you an opportunity to save modified files. Here, there is no indication that the file you see in the editor is NOT what will be stashed. This can be a frustrating way to lose work.

VS Code version: Code 1.41.0 (9579eda, 2019-12-11T17:58:38.338Z)
OS version: Darwin x64 18.7.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz (8 x 2900)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 2, 3, 3
Memory (System) 16.00GB (3.77GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (28)
Extension Author (truncated) Version
vscode-openapi 42C 2.1.0
Bookmarks ale 10.6.0
swagger-viewer Arj 2.2.2
atlascode atl 2.2.1
jira-frontend Atl 0.0.4
vscode-python-docstring aza 0.0.5
npm-intellisense chr 1.3.0
vscode-postgres cko 1.1.11
vscode-svgviewer css 2.0.0
vscode-markdownlint Dav 0.33.0
es7-react-js-snippets dsz 2.5.0
swagger-generator dwa 0.1.1
gitlens eam 10.2.0
vscode-npm-script eg2 0.3.10
todo-tree Gru 0.0.162
restructuredtext lex 116.0.0
vscode-docker ms- 0.9.0
vscode-kubernetes-tools ms- 1.0.9
mssql ms- 1.8.0
python ms- 2019.11.50794
vsliveshare ms- 1.0.1404
vscode-jest Ort 3.1.0
material-icon-theme PKi 3.9.2
vscode-yaml red 0.6.1
tech-debt-tracker Ste 0.21.0
code-spell-checker str 1.7.20
mako tom 0.2.0
pdf tom 0.5.1

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalitygitGIT issuesinsiders-releasedPatch has been released in VS Code Insiderson-release-notesIssue/pull request mentioned in release notesverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions