Reputation: 2079
I have a git repository folder opened in VSCode. After hitting cmd+s to save a file I'm currently working on, this action often deletes all of the tracked files in the repository and adds them to be commited state. I always have to do hard reset of the repo to revert the changes which is not the best option especially in situations when I had several files changed.
I have no idea what the problem may be. I'm working on a mac, so I've been looking for similar issues with iCloud but I don't really know whether it is caused by iCloud, VSCode, git, or anything else in my system.
I tried to block the iCloud syncing by putting a .nosync
file to the directory but that didn't help.
Has anyone encountered similar issues? DO you have some ideas where should I look to find our more about it?
Upvotes: 1
Views: 213
Reputation: 1524
I saw a similar thread about this over on the Apple Stack Exchange. It seems that in general you may want to not have your git repos in an iCloud-managed folder. My Documents folder is managed by iCloud, but I've always just kept my repos in ~/Projects, which isn't on iCloud, and I've had no problems.
A way you could test this is to clone a repo into ~/Projects (assuming it's not managed by iCloud) and see if you have the same "commit all the things!" issue there. If you do, then you know it's a git vs. VSCode thing and that iCloud doesn't have anything to do with it. If nothing else, removing that variable from the equation will help clarify the source of the problem.
Best of luck!
Upvotes: 1