Change:
<!-- Do Not Delete This! featurerequesttemplate --<!-- Please read our Rules of Conduct: --<!-- Please search existing issues to avoid creating duplicates. --Quite often I want to have open only the files that are modified from source control. It would be handy to have a "Close all Unmodified" option that would close any open files that are not modified according to source control.
I would like to contribute on this.
Verification steps: a folder/workspace that contains a git repository auto-save using the setting multiple files, make changes, and save them multiple files but do not make any changes a file, make changes, but do not save it the "Git: Close All Unmodified Editors" command Confirm that all modified files remain open Confirm that the dirty editor remains open Confirm that all unmodified editors are closed

Discussion:
"enablement": "!operationInProgress" }, { <ins> "command": "git.closeAllUnmodifiedEditors", "title": "%command.closeAllUnmodifiedEditors%", "category": "Git", "enablement": "!operationInProgress" }, { </ins> "command": "git.api.getRepositories", "title": "%command.api.getRepositories%", "category": "Git API"

"command.cleanAllTracked": "Discard All Tracked Changes", "command.cleanAllUntracked": "Discard All Untracked Changes", "command.closeAllDiffEditors": "Close All Diff Editors", <ins> "command.closeAllUnmodifiedEditors": "Close All Unmodified Editors", </ins> "command.commit": "Commit", "command.commitAmend": "Commit (Amend)", "command.commitSigned": "Commit (Signed Off)",

import * as os from 'os'; import * as path from 'path'; <del> import { Command, commands, Disposable, LineChange, MessageOptions, Position, ProgressLocation, QuickPickItem, Range, SourceControlResourceState, TextDocumentShowOptions, TextEditor, Uri, ViewColumn, window, workspace, WorkspaceEdit, WorkspaceFolder, TimelineItem, env, Selection, TextDocumentContentProvider, InputBoxValidationSeverity, TabInputText, TabInputTextMerge, QuickPickItemKind, TextDocument, LogOutputChannel, l10n, Memento, UIKind, QuickInputButton, ThemeIcon, SourceControlHistoryItem, SourceControl, InputBoxValidationMessage } from 'vscode'; </del> <ins> import { Command, commands, Disposable, LineChange, MessageOptions, Position, ProgressLocation, QuickPickItem, Range, SourceControlResourceState, TextDocumentShowOptions, TextEditor, Uri, ViewColumn, window, workspace, WorkspaceEdit, WorkspaceFolder, TimelineItem, env, Selection, TextDocumentContentProvider, InputBoxValidationSeverity, TabInputText, TabInputTextMerge, QuickPickItemKind, TextDocument, LogOutputChannel, l10n, Memento, UIKind, QuickInputButton, ThemeIcon, SourceControlHistoryItem, SourceControl, InputBoxValidationMessage, Tab, TabInputNotebook } from 'vscode'; </ins> import TelemetryReporter from '@vscode/extension-telemetry'; import { uniqueNamesGenerator, adjectives, animals, colors, NumberDictionary } from '@joaomoreno/unique-names-generator'; import { ForcePushMode, GitErrorCodes, Ref, RefType, Status, CommitOptions, RemoteSourcePublisher, Remote } from './api/git';

repository.closeDiffEditors(undefined, undefined, true); } <ins> @command('git.closeAllUnmodifiedEditors') closeUnmodifiedEditors(): void { const editorTabsToClose: Tab[] = []; // Collect all modified files const modifiedFiles: string[] = []; for (const repository of this.model.repositories) { modifiedFiles.push(...repository.indexGroup.resourceStates.map(r => r.resourceUri.fsPath)); modifiedFiles.push(...repository.workingTreeGroup.resourceStates.map(r => r.resourceUri.fsPath)); modifiedFiles.push(...repository.untrackedGroup.resourceStates.map(r => r.resourceUri.fsPath)); modifiedFiles.push(...repository.mergeGroup.resourceStates.map(r => r.resourceUri.fsPath)); } // Collect all editor tabs that are not dirty and not modified for (const tab of window.tabGroups.all.map(g => g.tabs).flat()) { if (tab.isDirty) { continue; } if (tab.input instanceof TabInputText || tab.input instanceof TabInputNotebook) { const { uri } = tab.input; if (!modifiedFiles.find(p => pathEquals(p, uri.fsPath))) { editorTabsToClose.push(tab); } } } // Close editors window.tabGroups.close(editorTabsToClose, true); } </ins> @command('git.openRepositoriesInParentFolders') async openRepositoriesInParentFolders(): Promise<void> { const parentRepositories: string[] = [];