Git Bash的确切含义是什么? [英] What is the exact meaning of Git Bash?

查看:94
本文介绍了Git Bash的确切含义是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近两天我一直在与Git Bash合作.我现在知道诸如commitpushpullfetchmerge的基本操作.但是我仍然不知道Git Bash 本身到底是什么!

I have been working with Git Bash for the last two days. I know now the basic operations such as commit, push, pull, fetch, and merge. But I still don't know what Git Bash itself actually is!

我搜索了很多有关Git Bash的信息,但是我看到的所有站点都集中在其命令的功能上.对于我的问题,我仍然没有找到好的答案.现在,我想,我来对地方了!

I've searched a lot about Git Bash, but all sites which I have seen focus on the functionality of its commands. I still haven't found a good answer for my question. Now, I think, I'm in the right place to get this answer!

推荐答案

git bash是一个shell,其中:

git bash is a shell where:

  • the running process is sh.exe (packaged with msysgit, as share/WinGit/Git Bash.vbs)
  • git is a known command
  • $HOME is defined

请参见"修复msysGit Portable $HOME位置":

See "Fix msysGit Portable $HOME location":

在Windows 64上:

On a Windows 64:

C:\Windows\SysWOW64\cmd.exe /c ""C:\Prog\Git\1.7.1\bin\sh.exe" --login -i"

这与 git-cmd.bat 不同,后者提供了git普通的DOS命令提示符中输入命令.

This differs from git-cmd.bat, which provides git commands in a plain DOS command prompt.

诸如适用于Windows的GitHub(G4W)之类的工具提供了

A tool like GitHub for Windows (G4W) provides different shell for git (including a PowerShell one)

2015年4月更新:

注意:用于Windows 1.9.5的msysgit/Git中的git bash是一个旧版本:

Note: the git bash in msysgit/Git for windows 1.9.5 is an old one:

GNU bash, version 3.1.20(4)-release (i686-pc-msys)
Copyright (C) 2005 Free Software Foundation, Inc.

但随着逐步淘汰msysgit (2015年第四季度)和新的 msys2项目(基于MSYS的独立重写),基于bbit进行了更新.在现代Cygwin(POSIX兼容层)和MinGW-w64上运行,目的是更好地与本机Windows软件实现互操作性. msys2也带有它自己的安装程序.

But with the phasing out of msysgit (Q4 2015) and the new Git For Windows (Q2 2015), you now have Git for Windows 2.3.5.
It has a much more recent bash, based on the 64bits msys2 project, an independent rewrite of MSYS, based on modern Cygwin (POSIX compatibility layer) and MinGW-w64 with the aim of better interoperability with native Windows software. msys2 comes with its own installer too.

现在git bash(带有用于Windows的新Git):

The git bash is now (with the new Git For Windows):

GNU bash, version 4.3.33(3)-release (x86_64-pc-msys)
Copyright (C) 2013 Free Software Foundation, Inc.


原始答案(2013年6月) 更准确地说,来自 msygit Wiki :


Original answer (June 2013) More precisely, from msygit wiki:

从历史上看,只有使用Cygwin才正式支持Windows上的Git.
为帮助制作本机Windows版本,该项目基于 mingw fork开始 .

Historically, Git on Windows was only officially supported using Cygwin.
To help make a native Windows version, this project was started, based on the mingw fork.

为使项目名称的乳白色汤"更清晰,我们这样说:

To make the milky 'soup' of project names more clear, we say like this:

  • msysGit -是该项目的名称,它是Windows版Git的构建环境,它会发布官方二进制文件
  • MinGW -是用于本机Microsoft Windows应用程序的简约开发环境.
    它实际上是Microsoft Runtime上非常薄的编译时层.因此,MinGW程序是真正的Windows程序,没有Unix样式的路径或POSIX细微之处(例如fork()调用
  • )的概念.
  • MSYS -是Bourne Shell命令行解释器系统,由MinGW(和其他公司)使用,是以前从Cygwin分支的
  • Cygwin -一种类似于Linux的环境,过去曾用于构建Windows的Git,如今与msysGit无关.
  • msysGit - is the name of this project, a build environment for Git for Windows, which releases the official binaries
  • MinGW - is a minimalist development environment for native Microsoft Windows applications.
    It is really a very thin compile-time layer over the Microsoft Runtime; MinGW programs are therefore real Windows programs, with no concept of Unix-style paths or POSIX niceties such as a fork() call
  • MSYS - is a Bourne Shell command line interpreter system, is used by MinGW (and others), was forked in the past from Cygwin
  • Cygwin - a Linux like environment, which was used in the past to build Git for Windows, nowadays has no relation to msysGit

因此,关于"git bash"的两行描述是:

So, your two lines description about "git bash" are:

"Git bash"是"Git for Windows"中包含的msys shell,并且是Cygwin的精简版(当时是旧版本),其唯一目的是提供足够的POSIX.层来运行bash.

"Git bash" is a msys shell included in "Git for Windows", and is a slimmed-down version of Cygwin (an old version at that), whose only purpose is to provide enough of a POSIX layer to run a bash.

提醒:

msysGit是用于Windows编译Git的开发环境.就您只需要安装msysGit而言,然后就可以构建Git而言,它是完整的.无需安装任何第三方软件.

msysGit is the development environment to compile Git for Windows. It is complete, in the sense that you just need to install msysGit, and then you can build Git. Without installing any 3rd-party software.

msysGit不是Windows的Git.那是一个安装Git的安装程序-仅安装Git .

请参阅" msysgit与Cygwin + git之间的区别?.

这篇关于Git Bash的确切含义是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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