Why can’t the MinGW version of Git (Git for Windows) be called from MSYS2 Bash?

I’m currently learning how to use Linux utilities as part of my workflow via MSYS2 on Windows OS, and I learned (if my understanding is correct) that the Git which comes with MSYS2 is compiled with Cygwin, and therefore calls POSIX APIs as it runs, which MSYS2 has to emulate. This causes the Git that comes with MSYS2 to run “quite a bit slower”, according to the MSYS2 website. I also found people on Reddit complaining that it’s slow.

Meanwhile, the Git that comes with Git for Windows is modified (?) to only need the Win32 API and compile with MinGW, so it’s faster as it doesn’t need the POSIX emulation. I did some more research and found that the Git for Windows team wrote a guide teaching you how to install their MinGW version of Git inside MSYS2. But they also put a big warning right at the top of the page stating that this is not a supported method of using Git for Windows and might cause bugs.

Now the part I don’t understand is, why does the shell that you’re calling the executable from matter if it’s already compiled? My understanding is that if you compile a program with MinGW, then it would always only have access to Win32 APIs no matter if you call it from Command Prompt or MSYS2 Bash, and if you compile a program with the GCC provided inside MSYS2, then it would always have access to POSIX APIs no matter where you call it from. So seeing as the executable provided by “Git for Windows” is already compiled, why can’t I just simply call the Git for Windows executable directly instead of “installing” it in MSYS2 Bash (which is not recommended according to the Git for Windows team)? What confuses me even more is that the Git for Windows executable is clearly designed to work in both CMD/PowerShell and Bash, since Git for Windows installs “Git CMD” and “Git Bash” for you to choose one to use git in (I guess the executable somehow detects what shell it is running in and adjusts output line-endings accordingly?). Therefore it can’t be a CR v.s. CRLF line-ending issue. Is it that the Git executable is dynamically linked to a library that it would fail to find if you called it from outside Git (CMD/Bash), or something like that?

I opened Git Bash and ran which git, and this gives me the path /mingw64/bin/git. Combined with the installation directory of Git for Windows, I assume the full path it’s calling is "%PROGRAMFILES%Gitmingw64bingit.exe" when I run git in Git Bash. I checked and there is indeed a git.exe at this location. So can’t I simply add alias git='"${PROGRAMFILES}\Git\mingw64\bingit.exe"' to my .bashrc file and use this from MSYS2 Bash? What problems would this cause, and why?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật