Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force overwrite of newer file in VS Code?

Is there a way to stop being prompted about overwriting a newer file, and just allow the editor to overwrite it without asking?

I ask because I'm experiencing a bug in VS Code 1.9.0 that others are also experiencing which causes the editor to erroneously interpret a remote file as newer, hence forcing the user to view a diff and confirm the overwrite. This can happen several times in a row when I make small changes to a file, and it really disrupts my workflow.

The bug is known of by Microsoft and two reports of it exist on their Github, unfortunately both have been Closed without being resolved (or perhaps the bug was fixed in an earlier version but recently reintroduced), so I'm just looking for a temporary workaround for now until (hopefully) they fix it again.

For what it's worth, my platform is Debian Stable (8/Jessie) and I have a remote server mounted via sshfs (facilitated through PCManFM).

like image 538
Brian J. Hodge Avatar asked Feb 04 '17 18:02

Brian J. Hodge


People also ask

How do you refresh a file with VS Code?

Choose Refresh from the Window menu, or click the Refresh button in the toolbar.

How do I redo changes in Visual Studio code?

You can undo/redo an operation in one of the following ways: From the Visual Studio's Edit menu. Clicking the undo and redo icons on the toolbar. Pressing CTRL+Z for undo and CTRL+Y for redo.

How do you undo last change in VS Code?

Click the (...) button and then select Undo Last Commit to undo the previous commit. The changes are added to the Staged Changes section.

How do I select all and replace in VS Code?

Ctrl + Shift + L to select all occurrences of current selection.


1 Answers

Check out this setting:

Files: Save Conflict Resolution A save conflict can occur when a file is saved to disk that was changed by another program in the meantime. To prevent data loss, the user is asked to compare the changes in the editor with the version on disk. This setting should only be changed if you frequently encounter save conflict errors and may result in data loss if used without caution.

screenshot of setting

like image 167
Stephen Blank Avatar answered Oct 25 '22 02:10

Stephen Blank