The editor could not be opened due to an unexpected error: Unable to read file ‘~’ (Error: Unable to read file ‘~’ that is actually a directory)

Problem

In VSCode, when trying to commit changes, there is a file that won’t be staged, and that is actually a directory. When we click that file in the git panel, we get the error message in the title.

Solution

Delete the .git directory in that directory.

rm -rf name_of_the_directory

Then remove the submodule from your main repository.

git rm --cached name_of_the_directory

发表评论

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理