Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to close the git diff panel in vscode?

Is it possible, preferably using a shortcut, to close a git diff window in vscode. I know you can close the sidebar by pressing the ctrl/cmd + B. What about the file git diff window. That shows working file on right and original file on the left.

The reason is that I may have bunch of files and then I go to see what have I changed and see one file. I see something I want to fixed in it and then start editing it but there is left window showing git diffs which I just want to close. But pressing x on file name closes everything both the current version of file and last committed version.

I guess another way to ask this question would be how to go from git diff window to file directly.

enter image description here

like image 571
Muhammad Umer Avatar asked Mar 24 '26 09:03

Muhammad Umer


1 Answers

VSCode 1.65 (Feb. 2022) - Release Notes > Diff Editor Management

There is a new command Git: Close All Diff Editors in the Command Palette that can be used to close all open diff editors.

There is also a new setting, git.closeDiffOnOperation to automatically close diff editors when changes are stashed, committed, discarded, staged, or unstaged

Related Issues:

  • Add setting to automatically close Working Tree tabs when window is closed or when commit has been made
  • Git: stale editor inputs hanging around
like image 138
VonC Avatar answered Mar 27 '26 03:03

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!