Git-scm,msysGit& Git for Windows [英] Differences between Git-scm, msysGit & Git for Windows

查看:134
本文介绍了Git-scm,msysGit& Git for Windows的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

git-scm (从 git- scm.com )和msysGit(托管于 Google Code ,<一个href =https://github.com/msysgit/msysgit/ =noreferrer> Github ,可能还有其他人)?它们看起来都非常相似,即使我有git-scm,我也应用了msysGit指定的修复程序,它们似乎工作正常。



另外,如果要么是 Git for Windows ,并且都被称为 Git Bash ,或者都有 Git Bash shell,或者只有两个之一?

解决方案

git-scm.com 是Git版本控制软件的官方网站。没有Git-SCM,这只是源代码管理(SCM)软件的URL-名称只是 Git 。最初是为Linux编写的,原始的Git软件只能作为在Windows上无法轻松编译的源代码。


如果你只是有兴趣在Windows上安装Git,那么你可以停止在这里阅读,只需从官方网站下载一个Windows build 。 p>



Git for Windows



Git for Windows 是专门为Windows构建Git的原生版本的项目。 Windows版本可在官方Git网站上下载,它们以32位和64位版本形式提供。



Windows的Git建立在MSYS2之上(是 MinGW < a>),它提供了一个最小的unix-like shell环境,用于运行Git的所有组件,这些组件不是用本地代码编写的(很多Git是作为shell脚本编写的)。为了用MSYS2构建Git,项目组有一个特殊的Git for Windows SDK,它基本上是在Windows上构建Git所需的整个构建环境,并且是

该项目维护自己的一个Git分支,它与最初的Git项目保持同步,但包含了构建它所需的一组补丁视窗。 Git for Windows 发布通常在正式版发布后短时间内发布(尽管版本有时跳过)。



msysGit



在Git版本2之前, >二进制文件是由名为 msysGit 的项目发布的,该项目是 Git for Windows 项目的前身。该项目于2015年8月18日停用,赞成使用重建的适用于Windows SDK的Git开发环境下的 Git for Windows 项目。这个新项目大部分是由同一个团队开始的。

许多人认为msysGit是Git二进制文件的名称,他们创建的开发环境的名称。它基于MSYS,这是MSYS2新鲜开始之前的老式和过时版本。 MSYS的坏状态是为什么 Git for Windows 项目是在完全改进的构建环境下启动的原因之一。



项目本质上发布了三件事:msysGit,适用于Windows的Git和适用于Windows的便携式Git。 msysGit安装程序将安装和设置在Windows上构建Git所需的开发环境,就像 Git for Windows SDK 现在一样。适用于Windows的Git是一个安装程序,可以在Windows机器上安装Git,而便携式Git for Windows只是您不需要安装的二进制文件。请注意,它们的所有版本均以预览版本形式发布,这意味着它们不会完全受支持的版本。尽管如此,该项目已经非常成熟,并且发布的版本非常稳定,并且是在Windows上设置Git的事实上最好的方式。

Git Bash



如上所述,很多Git都是作为shell脚本编写的。为了执行这些脚本,Git for Windows使用与MSYS2捆绑在一起的 Bash (所以Bash的工作原理是Git Bash 通常指的是 Git for Windows 安装程序创建的快捷方式。 它启动了一个运行Bash的全功能控制台窗口,因此您可以使用Git以及一组常用命令行工具或Unix程序(如 less awk grep ,甚至是文本编辑器 VIM )。特别是对于经验较少的用户,Git Bash是与Git交互的常用方式,但您可以从更多以Windows为中心的环境中轻松使用它,例如 PowerShell



从Git版本2开始,默认情况下,Git Bash将在MinTTY中启动,终端模拟器,它可以轻松使用,即使对于不熟悉控制台体验的用户也是如此。

要知道在设置 Git for Windows 期间,即使您决定不将任何Git可执行文件添加到PATH中, Git Bash 也将始终有效。然而,我个人的建议是在PATH中添加Git可执行文件( Git可执行文件,选择在Windows命令提示符下使用Git选项)。这样,您可以使用其他shell(cmd.exe或PowerShell)中的Git,其他程序也可以访问它(例如,许多库甚至IDE集成都希望PATH中的Git可执行文件与Git存储库交互)。 p>

What is the difference between git-scm (downloaded from git-scm.com) and msysGit (hosted on Google Code, Github, and probably others)? They both seem pretty similar, and even though I have git-scm, I have applied fixes specified for msysGit and they seem to work fine.

Also, which one, if either, is Git for Windows, and are both called Git Bash, or do both have the Git Bash shell, or only one of the two?

解决方案

The website git-scm.com is the official website for Git, the version control software. There is no "Git-SCM", that’s just the URL of the source control management (SCM) software—the name is just Git. Originally written for Linux, the original Git software is only available as a source that doesn’t compile easily on Windows.

If you are just interested in installing Git on Windows, then you can stop reading here and just download a Windows build from the official website.

Git for Windows

Git for Windows is the project dedicated to building native builds of Git for Windows. The Windows releases are available for download on the official Git website, they come as 32-bit and 64-bit builds.

Git for Windows is built on top of MSYS2 (a part of MinGW) which provides a minimal unix-like shell environment which is used to run all the components of Git which are not written in native code (a lot of Git is written as shell scripts). In order to build Git with MSYS2, the project group has a special "Git for Windows SDK" which is basically the whole build environment needed to build Git on Windows, and comes with everything you need to start working on Git itself.

The project maintains its own fork of Git which is kept up to date with the original Git project but contains a set of patches necessary to build it on Windows. Git for Windows releases are usually released with a short delay after the official version is released (although versions are sometimes skipped).

msysGit

Prior to Git version 2, the Git for Windows binaries were released by the project called msysGit, which is the predecessor of the Git for Windows project. The project was retired on August 18, 2015 in favor to launch the Git for Windows project with the rebuilt Git for Windows SDK development environment. The new project was mostly started with the same team.

While many people thought of msysGit as the name of the Git binaries, that was actually the name of the development environment they created. It was based on MSYS, the older and kind-of outdated version before MSYS2 was started fresh. The bad state of MSYS was one of the reasons why the Git for Windows project was started with a completely revamped build environment.

The project essentially released three things: msysGit, Git for Windows, and a portable Git for Windows. The msysGit installer would install and set up the development environment required to build Git on Windows, just like the Git for Windows SDK does now. Git for Windows was an installer that would install Git on a Windows machine, and the portable Git for Windows were just the binaries you wouldn’t have to install. Note that all their releases were released as "preview" builds, meaning that they would not be fully supported releases. Despite that, the project was very mature and the releases were very stable and the de-facto best way to set up Git on Windows.

Git Bash

As mentioned above, a lot of Git is written as shell scripts. In order to execute those scripts, Git for Windows uses Bash that comes bundled with MSYS2 (so Bash works as an interpreter for it).

Git Bash commonly refers to the shortcut the Git for Windows installer creates. It launches a full featured console window running Bash, so you can use Git as well as a set of common command line tools or Unix programs (like less, awk, grep, or even the text editor vim). Especially for less experienced users, Git Bash is the common way to interact with Git, although you could easily use it from more Windows-centric environments like PowerShell.

Starting with Git version 2, Git Bash will by default launch in MinTTY, a terminal emulator which comes with MSYS2, making it easily usable even for users not accustomed to a console experience.

It’s also useful to know that Git Bash will always work even if you decided not to add any Git executables to your PATH during the setup of Git for Windows. However, my personal recommendation is to add the Git executable (just the Git executable, choosing the option "Use Git from the Windows Command Prompt" during setup) to the PATH. That way, you can work with Git from other shells (cmd.exe or PowerShell), and other programs can access it too (e.g. many libraries or even IDE integrations expect a Git executable in the PATH to interact with Git repositories).

这篇关于Git-scm,msysGit&amp; Git for Windows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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