VSCode: git fatal error: file is outside directory

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.


What fixed it for me was:

Being a Windows and VScode user, I fixed this by updating GIT. You do that by going to https://gitforwindows.org/ and installing.


my vs code recently got updated to May 2020 release. Just after this the above git issue starting happening. So i rollback version of my vs code to April 2020 release and now again git extension works


If you use ASCII / Special chars (like æøå) in your path name this error occurs. Rename your path names / directories to the fix issue.

Be aware all parent paths for your projects directory needs to be changed, not just your paths / directories within your project.


Looks like the root cause mentioned in someone else's answer is correct:

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.

I can see the git error complaining about e:\... while Windows shows E:\....

Adding ignorecase=true didn't do it for me. Instead, I ran git version (which reported 2.9.x). The latest git as of writing was 2.27.y. Upgrading git solved it for me.