Sublime Forum

Random file deletion (unstaged changes)



Sometimes when I open SublimeMerge (or possibly, when switching repositories), I will suddenly have un-staged changes which amount to some random file having been deleted. I definitely did not actually delete the file, but SublimeMerge perceives that I did, and the file is missing in the filesystem.

Why might this be happening? Our local repo’s are all on network drives… Could that be related?

I realize I can just Discard the changes, but feel it’s probably better to NOT need to routinely prevent deletion of random files. Also, if this happens for others, it could really confuse newbies, as it did to me when I first encountered it, when I was still just beginning to understand git and SublimeMerge.

Any advice on how to prevent this from occurring is appreciated!

PS - thanks for the awesome Sublime products. SublimeText and Sublime Merge as very nice to use!



I’ve seen deleted files in the worktree after switching branches or rebasing if git was not able to write the file for some reason - maybe because it’s locked by another process or whatever.


It used to happen with markdown files if the repo was open in Sublime Text as well. Each time git manipulated a markdown file in the working directory ST tried to pick up the changes and locked the file (for too long), which in turn may have caused git to fail to update it at some point. As a result the file was gone. But havn’t seen it with ST 3207 anymore.

Sublime Merge just reads files and the git database if I recall correctly. All manipulations are handled by calling the git executable.