Skip to content

Git Bash doesn't work with Git for widows SDK out of the box #177268

@brice-gros

Description

@brice-gros

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.76.2
  • OS Version: Win11 22H2 (OS Build 22621.1344)

Steps to Reproduce:

  1. install Git for Windows SDK (without Git for Windows installed)
  2. Open VSCode with "terminal.integrated.defaultProfile.windows": "Git Bash" in vscode settings.json
  3. Open the vscode Terminal
  4. PowerShell opens (not Git Bash which is not listed either)

Potential fix:

Inside getGitBashPaths(), add some of these options:

  • Add the default installation c:\\git-sdk-64\\usr\\bin\\bash.exe as a special path
  • Add ${gitDir}\\usr\\bin\\bash.exe when pushing to gitBashPaths, so if c:\\git-sdk-64\\usr\\bin is in the PATH, findExecutable('git.exe') will add c:\\git-sdk-64 as a gitDirs, and c:\\git-sdk-64\\usr\\bin\\bash.exe will be pushed into gitBashPaths

Known workaround:

Create a link C:/Program Files/Git pointing to C:/git-sdk-64

# from git bash
# Assuming user with `SeCreateSymbolicLinkPrivilege` privilege (always true for admin users) and `export MSYS="winsymlinks:nativestrict $MSYS"` called in git bash
ln -s /c/git-sdk-64 /c/Program\ Files/Git
# or use NTFS Links
mklink /D "C:\Program Files\Git" "C:\git-sdk-64"

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code Insidersterminal-profilesverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions