Difference between msysgit and Cygwin + git?
Asked Answered
C

10

31

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.

Claribelclarice answered 29/6, 2010 at 19:36 Comment(0)
F
44

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:

We now have a light-weight Git for Windows SDK – which is essentially a standard MinGW/MSys system managed through the package manager mingw-get.

We decided to just phase out the name "msysGit" (as well as the GitHub org of the same name) and:

  • work on Git for Windows (with the corresponding GitHub org),
  • using the name "Git for Windows" for the installer aimed at "end-users" and
  • using the name "Git for Windows SDK" for the development environment targeting Git for Windows developers).

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 logo <----------> MsysGit logo
"Git for Windows": Pure users of Git | "MsysGit": for Testers, developers, custom installer maintainers

See also the msysgit FAQ:

What is this "MSys" thing in "MSysGit"?

MSys is an environment for Windows offering a Unix-type shell and a Perl interpreter. Because many parts of Git are still not builtins programmed in C, but instead shell and Perl scripts, Git for Windows needs such an environment.

Therefore we ship Git for Windows with a very minimal version of MSys.

MSys is also required to build Git, as we re-use the same Unix-type setup upstream Git uses. We ship a more complete MSys environment, including GCC, as build environment (which is therefore nick-named ''msysGit'').

We compile Git as a pure MinGW program, though, i.e. a program without any link-dependencies on anything but standard Windows libraries.
So unless you need to use any parts of Git that are still implemented only as shell or Perl scripts, you can get away with running plain git.exe.


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:

  • 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.
  • Git for Windows is an installer which installs Git -- and only Git.

It is easy to see the difference:

  • the installers for Git have the prefix Git-,
  • the msysGit installers have the prefix msysGit-.

Another telltale is that the msysGit installers come in two flavors: fullinstall and netinstall.
Further, msysGit does not install to C:\Program Files by default.
But msysGit comes with gcc, the GNU C Compiler.

c/ From MSysGitHerald10:

Remember:

  • MinGW 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, in contrast, 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.

And that is not always welcomed:

When working on Windows, I dislike that msysGit, as the name suggests, depends on MSYS and on tools from the Unix world. I believe all programs in the Git distribution should become binaries compiled for a specific platform, and not rely on shell interpreters or third-party languages like Tcl/Tk.

Even though, it is far better than the first Git on Cygwin installations from 2007.

Fatness answered 29/6, 2010 at 20:19 Comment(9)
a) How can I activate resize and copy/paste in Git bash ? b) I don't know if it is the same, but I'm using msysgit.Claribelclarice
@nusbit: a) like any Windows shell: see superuser.com/questions/92040/… or (clearer) astahost.com/info.php/Command-Prompt-Tips_t10211.html#137177 b) msysgit is the name of the project which includes "Git for Windows" (which you must have installed "Git-1.7.0.2-preview20100309.exe") and msysGit itself (the installer for the development environment of Git for Windows: msysGit-netinstall-1.7.1-preview20100612.exe).Fatness
a) I see you don't have installed Git Bash. Because it isn't like any windows shell. You can't resize is like windows cmd or other windows.Claribelclarice
@nusbit: my git bash shortcut points to C:\WINDOWS\system32\cmd.exe /c ""C:\Program Files\Git\bin\sh.exe" --login -i". What your Git bash shortcut refers to? When I open this windows (which has a vertical Git word as a logo), I can right-click on the title bar (which has MINGW32:~/. on it) and see the usual contextual menu (Restore/Move/Size/Minimize/Maximize/Close/Edit/Default/Properties). Do you see the same contextual menu?Fatness
The same. Thanks for this. I had to activate the QuickEdit Mode in the config. Now I can copy/paste.Claribelclarice
Note to self: for the difference between Git for Windows and msysgit: code.google.com/p/msysgit/source/…Fatness
I don't think this answers the question clearly. Besides the other explanations (which are mice but partially OT--especially that personal opinion of someone), you have basically just said that (sic) it's "better than Git on Cygwin installations from 2007". Not to mention that I assume there must have been already three years difference in 2010 (the time you answered)--so what would be the value of such comparison, and what is it now...?Wench
Is it possible to set user permissions when using MsysGit or would i need to install Gitolite. I would like to control who can check in and check out files from the repositoryIum
@Ium msysgit is just Git for Windows. And Git doesn't manage user permission. Only an authorization layer (gitolite.com/gitolite/auth.html) like Gitolite can.Fatness
K
4

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

  1. Put git in path and use window command prompt when I need command line
  2. Have tortoise git installed for when I want to have a GUI to my git
Kinna answered 29/6, 2010 at 19:40 Comment(2)
For a user who really likes command-line interfaces, I don't think windows command prompt is a very good solution...Yager
That isn't an answer to my question what the different ist between cygwin an msysgit.Claribelclarice
Y
4

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:

  • ACL handling. The way newer (post-2015) cygwins handles NTFS access control lists can be annoying to the point of dangerous. By default, the Windows drives are mounted with the acl option active. Cygwin tries to mimic POSIX permissions by re-shuffling and abusing ACL entries in a way which can make access through native windows programs impossible. Additionally it's possible that file access is slowed down dramatically in multi-user multi-domain (i.e., commercial or institutional) installations due to network access, because determining user and permissions potentially requires domain server queries for each file.

    msys mounts with the -noacl option by default. Doing that in cygwin as well seems to avoid those issues.
  • Speed. I'm currently working in a repository with 100k files (don't ask). A 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.
  • Potentially filenames. I have not investigated the issue but I would suspect that a git (and the other tools) targeted for windows (like msys git) can handle windows file names better. Under cygwin one must diligently convert file names via 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...).

Yuonneyup answered 20/7, 2017 at 18:20 Comment(0)
S
2

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.

Southernmost answered 23/1, 2013 at 2:5 Comment(0)
S
1

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.

Sulfonate answered 29/6, 2010 at 19:46 Comment(2)
The idea with VirtualBox is good, but a bit laborious for me. I would rather work with cygwin or msyswin.Claribelclarice
why not just connect to a virtual box instance running with shared folder? Once set up, I'm not sure what would be that labourous..Sulfonate
L
1

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).

Linares answered 17/5, 2011 at 17:19 Comment(0)
L
0

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.

Loci answered 5/11, 2014 at 17:9 Comment(0)
A
0

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.

Arched answered 23/8, 2016 at 2:14 Comment(1)
Three years later: If "windows/unix format" refers to line endings cygwin is configurable in this respect (use mount option text for certain paths in the /etc/fstab file for auto line ending conversion). How line endings are preserved is also dependent on your editors; modern ones are configurable in this respect, too, in addition to cygwin. I'm using cygwin and windows git in parallel and it works fine for now.Yuonneyup
D
0

This is an answer from 2018...

Git for Windows is based on MSYS2.

MSYS2 was started with the idea to restart the MSys project, frequently updating with Cygwin and just keeping the spirit of MSys to provide a very stripped-down POSIX layer, essentially a bare-minimum version of Cygwin. MSYS2 also sports a package manager (pacman) and keeps those packages up-to-date very well.

..

MSYS2's runtime is a stripped-down, slightly modified Cygwin runtime running on top of the Windows kernel, while Linux' runtime is the Linux kernel, running as a separate OS altogether.

https://github.com/git-for-windows/git/wiki

Cygwin provides a runtime library called cygwin1.dll that provides the POSIX compatibility layer where necessary. The MSYS2 variant of this library is called msys-2.0.dll and includes the following changes to support using native Windows programs: How does MSYS2 differ from Cygwin

Dependency Walker Git Bash

Don answered 26/1, 2018 at 12:15 Comment(0)
E
0

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.

Embryogeny answered 4/12, 2019 at 0:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.