msys / git和git-for-windows / mingw-w64-x86_64-git有什么区别? [英] What are the differences between msys/git and git-for-windows/mingw-w64-x86_64-git?

查看:306
本文介绍了msys / git和git-for-windows / mingw-w64-x86_64-git有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了能够在Windows上为我的跨平台应用程序运行测试脚本,我安装了MSYS2并使用pacman来安装我的测试脚本依赖的任何软件包。



<由于MSYS2提供了一个git(msys / git)的端口,我认为不需要为Windows安装Git。但是,MSYS2存储库提供的git版本与Git for Windows提供的git版本有什么不同?



到目前为止,我注意到了这些差异:


  1. msys / git在virtualenv上运行 pip freeze 时会失败,在开发模式下安装git克隆:

    pre $ FileNotFoundError:[WinError 3]系统找不到指定的路径:'/ c '/ $ user / documents / project / -windows / mingw-w64-x86_64-git不会失败,所以至少在路径处理方面有一些不同。
  2. Git for Windows的gitk和git gui开箱即用。无需设置 GIT_GUI_LIB_DIR 环境变量这里描述


现在最好的体验。



PS您可以通过将以下内容添加到 /etc/pacman.conf above [mingw32] [mingw64] [msys] 条目。但是,改为安装Git for Windows SDK可能更好,这是基本上是MSYS2的特别版,包括适用于Windows的Git。否则,下面的过程(以及更多)也是描述这里

  [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

之后(也许是 pacman -Sy

  pacman -S mingw-w64-x86_64-git 

我想没有理由不在Windows上安装Git for MSYS2?



编辑 Git for Windows(un)安装程序留下 C:\程序数据\Git\config 。这表明git位于SSL证书的错误位置。您可以删除 C:\ Program Data \Git\config 以解决此问题。

解决方案< msys / git 与MSYS2提供的动态库链接,以类似于cygwin的方式提供POSIX-to-Windows兼容性(POSIX仿真)(MSYS2从cygwin),因此它需要运行MSYS2环境。



git-for-windows / mingw-w64-x86_64-git 另一方面,它使用MinGW编译器进行编译,该编译器在编译时执行本地Windows调用的转换,与模拟方法相比,二进制的速度更快,并且只需要本地Windows库即可运行。



MSYS2与MinGW的区别 b
$ b


MSYS2 bin的POSIX仿真层aries很方便,但是需要付出代价:通常情况下,MSYS2程序明显比MinGW的程序慢(如果有这样的对应程序)。因此,Git for Windows项目试图提供尽可能多的组件以作为MinGW二进制文件。


另请参阅: MSYS2与Cygwin有什么不同?


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:\ProgramData\Git\config. This points git at the wrong location for the SSL certificates. You can remove C:\ProgramData\Git\config to fix this.

解决方案

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?

这篇关于msys / git和git-for-windows / mingw-w64-x86_64-git有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆