DEV Community

Discussion on: Visual Studio Code always ask for permission to save files in Linux

Collapse
 
metruzanca profile image
Samuele Zanca

Your problem here is a lack of a CI/CD pipeline.
You should be editing these files somewhere locally, not directly on the server you're using. When on local you can setup your environment within your userspace, then commit and have your pipeline make the changes.

I can see how this might not be easy first time around, but I would stress that its an important thing to learn.

If you must edit a single file, and you're on linux. Why not just sudo nano file.ext? Generally won't be spending a lot of time in config files, so you don't need a full code editor.

Thread Thread
 
rahedmir profile image
Mir Rahed Uddin • Edited

I know I can do it locally, This article is not about whether I can do it locally or on a server. This article more about how you can tackle this problem for a specific text/code editor. And, here in our case which is VS Code editor. (As I mentioned in the article's title)

Thread Thread
 
metruzanca profile image
Samuele Zanca

There's two ways to solve a problem:

  1. Solve the problem
  2. Figure out why the problem occurred and see if it can be avoided.

In this case, the problem can be easily avoided and usually is as when you're on a server you're also likely ssh-ed into it and off chance you're using vscode-ssh you'll likely know how to sudo vscode.

I don't care what the original topic was, this got brought up (by you) and I shared my thoughts on it.