Skip to content

Instantly share code, notes, and snippets.

@startergo
Last active January 8, 2025 01:16
Show Gist options
  • Save startergo/040b41f1a60566cbad267bb928890499 to your computer and use it in GitHub Desktop.
Save startergo/040b41f1a60566cbad267bb928890499 to your computer and use it in GitHub Desktop.
Git credentials manager add support for a MSYS2 Shell

https://github.com/git-for-windows/git/wiki/Install-inside-MSYS2-proper

  • Open a PowerShell as administrator, and enter the following command:
New-Item -ItemType SymbolicLink -Path 'C:\msys64\opt\git-for-windows-mingw64-bin' -Target 'C:\Program Files\Git\mingw64\bin'

This asumes that both paths exist and you have both Git for Windows and MSYS2 installed on those default locations, change them according to your needs.

  • Next, add the following 2 lines to your .gitconfig file in you MSYS2 homefolder:
[credential]
	helper = /opt/git-for-windows-mingw64-bin/git-credential-manager
[credential "https://dev.azure.com"]
	useHttpPath = true
  • Note that directly using a symlink to only the git-credential-manager binary does not work, because it's going to result in an error about missing libraries. A .NET application (since that's what it is) searches for libraries in the same folder, so it needs to have that context around.

Why this way? The reason is that in this way you can benefit from automatic updates made by the Git for Windows updater, taking away your need to keep manually downloading and extracting ZIP-files for each new update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment