Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop VS Code to duplicate files? (FileName 2.css)

I'm using VSCode in Mac and usually, they auto duplicate some file randomly. I suspect that could be related to some git config or command. As you can see, this time the VisualStudio Code generated only 263 files with 2 at the end of the name, but sometimes this happens to 3,000 or 5,000 files.

Why does this happen?

How can I stop it?

Version: 1.46.1
Commit: cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
Date: 2020-06-17T21:17:14.222Z (2 wks ago)
Electron: 7.3.1
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.5.0

enter image description here enter image description here

This is my current activated extensions.

enter image description here

like image 797
Rafael Perozin Avatar asked Dec 05 '22 08:12

Rafael Perozin


1 Answers

After a lot of investigation due to files that randomly get:

  • duplicated and suffixed by numbers
  • deleted

I discovered that it was caused by iCloud Drive. It was configured by default to sync my user directory. Disabling iCloud Drive or configuring it appropriately (by excluding any project managed by git) should fix this issue.


In summary, add .nosync in the name of your root file to solve the problem.

Example: Your app folder name is awesome-app, change it for awesome-app.nosync and iCloud will not sync it.

like image 153
Jarchiii Avatar answered Jan 12 '23 01:01

Jarchiii