msysgit 和 Cygwin + git 有什么区别?
现在我正在使用 msysgit,但我不喜欢 Git Bash(你不能调整大小或复制/粘贴),所以我正在考虑切换到 Cygwin,因为这样我就可以使用 mintty。
What is the difference between msysgit and Cygwin + git?
Now I'm using msysgit, but I don't like the Git Bash (you can't resize or copy/paste) so I'm thinking think about switching to Cygwin, because then I could use mintty.
发布评论
评论(10)
cygwin + git 是当时让 git 工作的唯一方法。现在 msysgit 已经出现了,我看不出有任何理由使用 cygwin。
我同意 git bash 不是那么好..所以我所做的是
cygwin + git was the only way to make git work back in the day. Now that msysgit is around, I don't see any reason to use cygwin.
I agree git bash isn't that good.. so what I do is
这是2017年的答案...
根本的技术区别是所有cygwin程序都依赖于cygwin1.dll;但这同时也是最终用户最不感兴趣的,因为它应该几乎完全透明。我发现的主要差异不是 git 版本之间的差异,而是 cygwin 环境和 msys/mingw 环境之间的差异。以下是我发现的一些差异:
msys 默认使用
-noacl
选项挂载。在 cygwin 中这样做似乎也可以避免这些问题。编辑:也许不明显的是,通过一些小的调整,可以在 cygwin 和 Msys2 之间共享 git(但不仅限于 git)的通用设置。如果我没记错的话,一个好方法是在 Windows 系统设置中设置 HOME 环境变量;那么 Msys2 和 cygwin 都将使用该目录,因此使用相同的点文件,其中
~/.gitignore
。这使得 cygwin 和 Msys2 终端之间的更改变得非常轻松(想想~/.inputrc
、~/.bashrc
、~/.profile
... )。This is an answer from 2017...
The fundamental technical difference is that all cygwin programs depend on the cygwin1.dll; but that's at the same time the least interesting one for the end user since it should be almost completely transparent. The main differences I found are not between the git versions as much as between the cygwin environment and msys/mingw environment. These are some differences I found:
msys mounts with the
-noacl
option by default. Doing that in cygwin as well seems to avoid those issues.git status
with all relevant disk contents in the cache takes 4.7 seconds with cygwin and 0.4 seconds with msys git. I'm not sure which part of the cygwin compatibility layer is slowing things down -- locks, forks, filesystem, IPC... they all are candidates.cygpath
between the two worlds. That will play an important role when scripts etc. interface with Windows programs.Edit: it is perhaps not obvious that with some minor tweaks it is possible to share common settings for git (but not only for git) between cygwin and Msys2. If I remember correctly a good way is to set the HOME environment variable in the Windows system settings; then both Msys2 and cygwin will use that directory and hence the same dot-files, among them
~/.gitignore
. That makes changing between cygwin and Msys2 terminals pretty painless (think~/.inputrc
,~/.bashrc
,~/.profile
...).MSysGit 附带了一个非常旧的 SSH 版本。我的系统吞吐量约为 10 Mbit。如果您不关心克隆速度,那么这不会影响您。修复方法是运行 Cygwin Git 或 替换 MSysGit 中安装的 SSH。
MSysGit ships with a very old version of SSH. Throughput on my system was around 10 mbit. If you don't care about clone speeds, then this does not affect you. The fix is to either run Cygwin Git or replace the SSH installed in MSysGit.
msysgit 中的 bash 实现很旧。不过,我在编辑时使用 vim,效果很好。至于剪切和粘贴,我经常使用 SHIFT+ALT+[空格]、E、M 或任何键来标记我想要的文本。不太理想,但工作做得足够好,因为我没有太多剪切和粘贴。
我现在开始通过 VirtualBox 在同一台机器上运行 Ubuntu。借助无缝模式和共享文件夹,我可以利用最新的 bash 和快速的 Git。
如果需要的话,我不会使用任何 Git 的 gui 工具,除了 gitk (for gitk --all) 来可视化历史记录。
我尝试过 cygwin 但不喜欢它。如果 msysgit 不足以满足您的需求,则虚拟盒解决方案会更好。
The bash implementation in msysgit is old. However, i use vim when editing and that works great. As for cutting and pasting, I often resort to SHIFT+ALT+[space], E, M or whatever the keys are to get to mark text I want. Not ideal, but does the job well enough as I don't cut and paste too much.
I've now started running Ubuntu on the same machine through VirtualBox. With seamless mode and shared folders, I can take advantage of an up to date bash and fast Git.
I do not use any gui tools for Git except gitk (for gitk --all) to visualize history if I need to.
I've tried cygwin and didn't like it. The virtual box solution is much better if msysgit is not enough for you.
cygwin 上 git 的当前版本是 1.7.5.1,这是非常非常最新的(2011 年 5 月)。
我认为(到目前为止)没有理由使用其他任何东西,尽管我正在考虑尝试 msysgit(又名“Git for Windows”)(当前版本为 1.7.4)。
The current version of git on cygwin is 1.7.5.1, which is very, very current (May, 2011).
I see no reason (so far) to use anything else, though I am considering giving msysgit (aka "Git for Windows") a try (currently version 1.7.4).
Msysgit 已收到许多补丁来处理 Windows 特定问题,例如文件系统不区分大小写、文件锁定等。使用 cygwin 版本可能不是一个好主意。如果您的系统上有 cygwin,我建议根本不要安装 git,并且最好不要从同一路径共享 msysgit 或 cygwin 环境。
Msysgit has received a number of patches to deal with Windows specific issues such as filesystem case insensitivity, file locking etc. It's probably a bad idea to use the cygwin version. If you have cygwin on your system I'd advise not installing git at all, and preferably not sharing msysgit or cygwin environments from the same PATH.
cygwin 以 Windows 格式查看本地文件,而 git-bash 以 unix 格式查看它们。如果您在 git-bash 中签出文件,然后在 cygwin shell 上运行 git status,git 会认为您已经修改了存储库中的每一行,如果您在 git-bash shell 中运行 git status,则只有您触及的文件会被修改。
cygwin sees your local files in windows format, whereas git-bash sees them in unix format. If you check out files in git-bash then run git status on a cygwin shell, git thinks you have modified every line in the repo, if you run git status in the git-bash shell, then only files you have touched are modified.
这是 2018 年的答案...
Git for Windows 基于 MSYS2。
..
https://github.com/git-for-windows/git/wiki
< img src="https://i.sstatic.net/ezHfq.png" alt="Dependency Walker Git Bash">
This is an answer from 2018...
Git for Windows is based on MSYS2.
..
https://github.com/git-for-windows/git/wiki
如果您打算在 git bash 中执行的不仅仅是 git 命令,我建议使用 Cygwin 和 git。
如果您打算在 git bash 中除了 git 命令之外不执行任何操作,那么 a) 当然,使用 git bash,但是 b) 为什么不只使用 Git GUI?
Git bash 并没有那么糟糕,但是,有时我需要使用 Cygwin 来完成在 git bash 中根本不起作用的事情。 (例如 Perl CPAN。另一个是 XSL 工具。)必须使用两个完全不同的 bash 命令行实现似乎真的很愚蠢。
If you plan on doing more than just git commands in git bash, I'd suggest Cygwin with git.
If you plan on not doing anything but git commands in git bash, then a) sure, use git bash, but b) why not just use Git GUI?
Git bash is not that bad, BUT, there's times when I need to use Cygwin for things that simply don't work in git bash. (Perl CPAN, for example. XSL tools, for another.) Which seems really silly to have to use two totally different bash command line implementations.
2018 年编辑:
自我 2010-2012-2014 年回答以来,2015 年 Windows 版 Git 使用 msys2,正如我详细信息。
请参阅“msys、msys2 和 msysgit 彼此之间有何关系?”了解更多信息。
编辑(两年后:2014 年 10 月)
Johannes Schindelin 刚刚解释了(2014 年 10 月)msysgit 已被淘汰:
两年后更新:2012 年 7 月
Msysgit 将继续存在,除非您需要为 cygwin 添加几百 MB,您真的不需要 Cygwin 就可以在 Windows 上使用 Git。
如果您想访问 GitHub,您将获得一个带有 Windows 版 GitHub。
Git 和 msysgit 位于 GitHub 上。
msysgit.github.com 页面清楚地说明了以下之间的区别:
<---------->
“Git for Windows”:Git 的纯用户 | “MsysGit”:适用于测试人员、开发人员、自定义安装程序维护人员
另请参阅msysgit 常见问题解答:
原始答案:2010 年 6 月
a/ 您可以在 Git bash 中调整大小和复制粘贴,就像在任何其他 Windows Shell 中一样。
b/ 您可能使用的是“Git for windows”,而不是 msysgit。来自 wiki:
c/ 来自 MSysGitHerald10:
这并不总是受欢迎:
尽管如此,它还是比第一个 Git on Cygwin 从 2007 年开始安装。
Edit 2018:
Since my 2010-2012-2014 answer, in 2015 Git for Windows uses msys2, as I detail here.
See more in "How are msys, msys2, and msysgit related to each other?".
Edit (2 more years later: October 2014)
Johannes Schindelin just explained (Oct. 2014) that msysgit is phased out:
Update 2 years later: July 2012
Msysgit is here to stay, and unless you need to add a few hundreds of MB for cygwin, you really don't need Cygwin to just use Git on Windows.
And if you want to access GitHub, you get one package ("Git for Windows" + ssh keys registered for you on your GitHub account + a nice GUI) with GitHub for windows.
Both Git and msysgit are on GitHub.
The msysgit.github.com page clearly illustrates the difference between:
<---------->
"Git for Windows": Pure users of Git | "MsysGit": for Testers, developers, custom installer maintainers
See also the msysgit FAQ:
Original answer: June 2010
a/ You can resize and copy-paste in Git bash, like in any other Windows Shell.
b/ You are probably using "Git for windows", and not msysgit. From the wiki:
c/ From MSysGitHerald10:
And that is not always welcomed:
Even though, it is far better than the first Git on Cygwin installations from 2007.