Skip to content

Git: Offer to clean workspace when checkout fails due to dirty working tree #59600

@levani

Description

@levani

When doing a checkout in vscode and there are local changes in current branch, vscode shows the following dialog:

screen 1

I think vscode can be smarter here and show the list of actual files that need to be committed or discarded and also offer some useful actions. Here is an example of how webstorm handles the same situation:

screen 2

Here is the list (probably not complete) of things I can do from that dialog. It would be nice to be able to do same things from vscode.

  • Force Checkout - Ignore current changes and checkout to the branch.
  • Smart Checkout - quote from jetbrains website: "shows the files preventing checkout and offers to stash local changes, checkout the branch, and then unstash changes back. If a conflict happens during unstash, merge dialog is shown."
  • Don't Checkout - just close the dialog and do nothing.
  • See the diff of individual modified files by double clicking (or from context menu). This would open vscode built in diff editor for that file to see the changes.
  • Revert individual files from the list from context menu:

screen 3

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalitygitGIT issueshelp wantedIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code Insidersverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions