Migrating to Visual Studio Code, I'm having trouble with the way it generates git commands from the IDE (Source Control panel, + symbol to add to the repo). Getting errors like this:
> git add -A -- C:\Projects\zwm\uniq.py
fatal: C:\Projects\zwm\uniq.py: 'C:\Projects\zwm\uniq.py' is outside repository at
'/cygdrive/c/Projects/zwm'
Obviously I'm trying to use the version of git
from Cygwin. Not having a problem finding git.exe, it's in the path. Git works fine if I just add -A uniq.py
from a cmd window.
Can I get VS Code to generate cygwin-style forward-slash paths? Or stop using absolute paths for files in the repo? Can't seem to find anything in the settings that addresses this.
Would this be a "terminal" issue, in that VS Code must be opening a terminal session to run git? This setting doesn't seem to make a difference: "terminal.integrated.defaultProfile.windows": "Cygwin"
. Nor does the setting in this promising answer: "terminal.integrated.profiles.windows": { "Cygwin": { ...
. I have not tried this suggestion from from github, about setting "terminal.integrated.profiles.windows": { "bash (MINGW64-MSYS2)": { ...
although it seems to be talking about using the terminal with bash-style paths.
Or ... should I be using instead some other version of git built for Windows that accepts backslash-delimited paths?
Using Windows 11, VS Code 1.85.2, git 2.42.1.
UPDATE: VS Code is smart enough to update the status of a file (from U to A) if I git-add the file manually. I can see git-show commands in the output window such as git show --textconv :4x4word.py
. So why is VS Code smart when issuing a git-show command, but dumb when generating git-add?