Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode: git fatal error: file is outside directory

I have been using VScode for a long time, and I have used the git functionality a lot. But it has suddenly started failing. Every time I try to add a file, a single file, it says there is an error:

git add -A -- ""repository folder""/README.md

fatal: ""repository folder""/README.md' is outside repository

I have checked the settings and there is nothing weird and also, when I add all files at once instead of just one at a time, it works well. If I add the files with the terminal's commands, it works too.

like image 341
jesusjimsa Avatar asked Nov 27 '17 10:11

jesusjimsa


1 Answers

I have got this problem after installing May 2020 VSCode update (v1.46).

After comparing git commands of the old and the new VSCode it appeared that updated VSCode uses low case drive letter in the path for the git command, but the old one used upper case letter. The ignorecase git option that should solve those problem was already set to true.

Updating git to version 2.27 solved the problem.

like image 198
Oleg Skydan Avatar answered Oct 02 '22 23:10

Oleg Skydan