Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The content on disk is newer. Click on Compare to compare your version with the one on disk

After update to 1.19.1 I'm getting this error constantly. The content on disk is newer. Click on Compare to compare your version with the one on disk.

like image 928
Ng Sharma Avatar asked Dec 19 '17 17:12

Ng Sharma


1 Answers

VS Code will show you an error message when you try to save a file that cannot be saved because it has changed on disk. VS Code blocks saving the file to prevent overwriting changes that have been made outside of the editor.

In order to resolve this issue, click the Compare action in the error message to open a diff editor that will show you the contents of the file on disk (to the left) compared to the contents in VS Code (on the right): {Refer an Image}

enter image description here

You must either accept the changes or revert the changes. Without taking any of the mentioned actions, you cant save the file.

P.S Above answer has been referred from visual studio code official documentation.

you can read detailed information about this topic: [https://code.visualstudio.com/docs/getstarted/tips-and-tricks#_preventing-dirty-writes][2]

like image 144
Aniket Jadhav Avatar answered Oct 23 '22 01:10

Aniket Jadhav