Skip to content

Conversation

@dmitrivMS
Copy link
Contributor

Fixes #111767

Added Git: Delete command which operates on the currently opened editor and runs git rm on the file, then closes the editor (if it is not dirty).

Added git.confirmCommittedDelete setting (on by default) to turn off the confirmation.

NOTE Since public API has no way to add a checkbox to the confirmation dialog, the setting can only be turned off from the settings file/UI.

Copilot AI review requested due to automatic review settings December 30, 2025 11:12
@dmitrivMS dmitrivMS added the git GIT issues label Dec 30, 2025
@dmitrivMS dmitrivMS self-assigned this Dec 30, 2025
@dmitrivMS dmitrivMS enabled auto-merge December 30, 2025 11:12
@dmitrivMS dmitrivMS requested a review from lszomoru December 30, 2025 11:12
@vs-code-engineering vs-code-engineering bot added this to the December / January 2026 milestone Dec 30, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new Git: Delete command that allows users to delete files from a Git repository using the git rm command, invoked from the currently open editor. The command includes safety checks to prevent accidental deletion of files with uncommitted changes and provides a confirmation dialog (configurable via the new git.confirmCommittedDelete setting).

Key changes:

  • Implements the git.delete command that runs git rm on the current document and closes the editor if not dirty
  • Adds a confirmation dialog with customizable setting git.confirmCommittedDelete (default: true)
  • Validates that files have no uncommitted changes before allowing deletion

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
extensions/git/src/commands.ts Implements the new delete command with uncommitted changes check, confirmation dialog, git rm execution, and editor closing logic
extensions/git/package.nls.json Adds localized strings for the "Delete" command name and the "confirmCommittedDelete" configuration description
extensions/git/package.json Registers the git.delete command with menu contribution and adds the git.confirmCommittedDelete boolean configuration setting

@dmitrivMS dmitrivMS modified the milestones: December 2025, January 2026 Jan 6, 2026
@dmitrivMS dmitrivMS assigned dmitrivMS and unassigned dmitrivMS Jan 6, 2026
@dmitrivMS dmitrivMS disabled auto-merge January 9, 2026 09:02
@dmitrivMS dmitrivMS enabled auto-merge (squash) January 10, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

git GIT issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git - Add a command palette option for git rm

2 participants