1

I am on version 1.30.0 , how can i fix the annoying question: do you want to save changes? I am using git so that takes care of my files already.

Gama11
  • 31,714
  • 9
  • 78
  • 100
bier hier
  • 20,970
  • 42
  • 97
  • 166
  • This question doesn't make a lot of sense. Note that Git tracks file contents, and as such, the changes really must be saved to file before Git can take care of them. – Marc.2377 Jun 29 '19 at 01:40
  • related: [Why don't other programs see the changes I made to a file in VS Code until I save those changes?](/q/76984829/11107541) – starball Aug 27 '23 at 07:43

2 Answers2

4

If you want code to autosave, you must turn it on in your settings.

You can open settings going to File/Preferences in windows or Code/Preferences in Mac.

To turn on autosave, search for the option "Auto Save" or the write "files.autoSave": "afterDelay" in you settings.json file. You should also take a look at the option "Prompt to save files before commit", or "git.promptToSaveFilesBeforeCommit": false in the file.

Rodrigo Rodrigues
  • 7,545
  • 1
  • 24
  • 36
  • Does not work for me. It keeps asking for saving unsaved files anyway, even though after I removed `~/.config/Code/User/data/settings.json`. Really confusing. – Dummmy Mar 19 '21 at 14:11
0

when another program changed something in your file, vscode has another text not like in real file that git changed it previously so it asked you to save for new

Ayoub Benayache
  • 1,046
  • 12
  • 28