I\'m reading the github wiki for git-for-windows and it says that msys2 bundles pacman: https://github.com/git-for-windows/git/wiki/Package-management
But when I invo
msys2 (Version 20190524 is tested.) or Git for Windows SDK . (Not fully tested, but it should work.) Both include PacMan and Git.Virtual Filesystem for Git (formerly was GVFS. Official website https://vfsforgit.org/ ) is recommended. Version 2.22 & 2.26 are tested. Scalar (Official website https://github.com/microsoft/scalar ) is NOT recommended, neither fully tested.
Install GVFS and Git for Windows with GVFS patch. Or install Scalar for Git and Git for Windows with Scalar patch. NOT BOTH on the same machine. The default installation destination is C:\Program Files\Git .
Install msys2 x64 somewhere else. By default, it is in C:\msys64 .
Copy files and subfolders of msys2 (except /etc and git binaries. The msys2 comes without git from factory.) to git for windows VFS edition, and copy /etc/pacman.d and /etc/pacman.conf in msys64 folder to Git folder, overwrite existing files. That will update msys2 and MinGW runtime to the latest version. For PacMan, the necessary files are /usr/bin/pac* ; /etc/pacman.conf ; /etc/pacman.d/ ; /var /usr/bin/msys* ; .(Not fully tested.)
Setup terminal applications. Run C:\Program Files\Git\bin\bash.exe will launch the bash of Git for Windows. Run C:\Program Files\Git\usr\bin\bash.exe will launch bash of msys2. Configure the path of bash for terminal programs, such as Hyper Terminal . Since Git is in a system folder, terminal programs should be Run as administrator .
Config $PATH the environmental variable for GVFS. Run this command in Git Bash. export PATH=$PATH:/c/Program\ Files/GVFS or export PATH=$PATH:"/c/Program Files/GVFS". Or set environmental variables for GVFS in system property of the control panel. Re-login to take effect. Sometimes this configuration does not work, but PacMan can still run.
Fix PacMan. Set executable permission for binaries. Fox example. chmod +x /usr/bin/pacman ; pacman-key --init ; pacman-key --populate msys2 ; pacman-key --refresh-keys ; pacman --sync pacman --refresh --sysupgrade --sysupgrade --overwrite "*" . Use the option --overwrite \* because some packages were installed by Git for Windows instead of PacMan.