Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
119 views
in Technique[技术] by (71.8m points)

What are the differences between msys/git and git-for-windows/mingw-w64-x86_64-git?

To be able to run the test scripts for my cross-platform application also on Windows, I installed MSYS2 and used pacman to install any packages my test scripts rely on.

Since MSYS2 provides a port of git (msys/git), I think there is no need to install Git for Windows as well. But what are the differences between the git version provided in the MSYS2 repository and the one provided by Git for Windows?

I noticed these differences so far:

  1. msys/git will fail when running pip freeze on a virtualenv where a Python package from a git clone is installed in develop mode:

    FileNotFoundError: [WinError 3] The system cannot find the path specified: '/c/users/user/documents/project/.git\..'
    

    git-for-windows/mingw-w64-x86_64-git doesn't fail, so there are at least some differences with respect to path handling.

  2. Git for Windows's gitk and git gui work out of the box. There's no need to set the GIT_GUI_LIB_DIR environment variable as described here.

It seems git from the Git for Windows repository offers the best experience at this point.

P.S. You can install Git for Windows's git in MSYS2 by adding the following to /etc/pacman.conf, above the [mingw32], [mingw64] and [msys] entries. But it might be a better idea to install the Git for Windows SDK instead, which is basically a special edition of MSYS2 including Git for Windows. Otherwise, the procedure below (and more) is also described here.

[git-for-windows]
Server = https://dl.bintray.com/$repo/pacman/$arch

[git-for-windows-mingw32]
Server = https://dl.bintray.com/git-for-windows/pacman/i686

After this (and perhaps a pacman -Sy), you can install the Git for Windows's git:

pacman -S mingw-w64-x86_64-git

I suppose there's no reason not to install Git for Windows's git in MSYS2?

EDIT The Git for Windows (un)installer left behind C:ProgramDataGitconfig. This points git at the wrong location for the SSL certificates. You can remove C:ProgramDataGitconfig to fix this.

question from:https://stackoverflow.com/questions/40262434/what-are-the-differences-between-msys-git-and-git-for-windows-mingw-w64-x86-64-g

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

msys/git is linked against a dynamic library provided by MSYS2 to provide POSIX-to-Windows compatibility (POSIX emulation) in a manner similar to how cygwin does (MSYS2 is forked from cygwin), thus it requires the MSYS2 environment to be present to run.

git-for-windows/mingw-w64-x86_64-git on the other hand, is compiled using the MinGW compiler, which performs the translation to native Windows calls at compile time, which results in a much faster binary compared to the emulation approach, and does only require native Windows libraries to run.

From The difference between MSYS2 and MinGW:

The POSIX emulation layer of MSYS2 binaries is convenient, but comes at a cost: Typically, MSYS2 programs are noticably slower than their MinGW counterparts (if there are such counterparts). As a consequence, the Git for Windows project tries to provide as many components as possible as MinGW binaries.

See also: How does MSYS2 differ from Cygwin?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...