23

I am running Windows 7, I just installed Cygwin for the first time today so I have been playing around with it. I am now wanting to start using Git as well.

From what I have read msysGit will allow you to use a GUI, and it also adds a right click on a folder/file Add to Git GUI and Add to GIT Bash context menu options.

At the same time though I would like to use the command line to do some Git stuff but I think as a Git beginner it would be nice to have the context menus and a GUI.

So I am kind of stuck. Couple of questions...

  1. If I install Git with msysGit can I still run the command line stuff for Git with Cygwin?

  2. One book said that you can install both Cygwin and msysGit it versions, if that is the case, do they both work on the same files/repo or is it like having 2 separate Git repos on every file? If that is the case then it seems like overkill.

  3. I also saw that msysGit has a portable version. If I were to use this portable version, does that mean that the Git repo is stored on the USB portable device or just the program? It would be cool if it is the Git program and the code repo stored portable.

1
  • msysgit version of git have a problem in supporting long pathnames, cygwin version not
    – user11153
    Commented Jul 22, 2014 at 11:45

6 Answers 6

17

1) If you are not using cygwin for anything else, and you want to use Git, go with msysgit. It brings in good Git integration to Windows and almost all GUI tools - Git Extensions, TortoiseGit and others that I know of, are dependent on msysgit. Also with msysgit, you can use git from cmd, powershell etc. which is not possible if you only have cygwin git.

msysgit comes with it's own bash and you can use that for command line and you won't need cygwin ( again, from point of you not using cygwin for other things). Almost all git features are available in msysgit and except for some Windows specific changes ( and performance), you will find that everything works in a comparable way to git on *nix. cygwin will not be as performant as msysgit and much less native git on *nix.

2) And it is possible to have them both and you don't need separate repos. They can co-exist peacefully.

3) Git repos are lightweight as they only involve filesystem. There is no concept of portable git repos, as they are effectively portable. Msysgit portable is meant to allow you to operate on Git repos on a system without installing msysgit.

3
  • What @manojlds means by 'no concept of portable' is that all git repos are portable by definition, being distributed vcs, and being a simple filesystem means you can put it anywhere - in fact, you could run an entire development environment off a USB if you wanted, with ide, msysgit and the repo all stored on there
    – MattJenko
    Commented Dec 3, 2011 at 23:53
  • 11
    One caveat to the statement "They can co-exist peacefully": I installed cygwin, but not the cygwin version of git because I already had msysgit installed. It turns out that the msysgit version of git will use the msysgit version of ssh which does NOT play well with Cygwin. If you're going to be using Cygwin, you should use the Cygwin version of git. I don't want to admit how many hours I wasted figuring that out. Commented Jan 28, 2013 at 21:22
  • While they can coexist peacefully, MSYS and Cygwin have different conceptions of what UNIX modes (permissions) to assign to files. This can be rather annoying when using Cygwin git in a msysGit-created repository. (But it's not the end of the world)
    – tjollans
    Commented May 25, 2016 at 8:38
16

You can use either or both -- but there are some things to watch out for.

At my most recent job, most of the team was using msysGit; I used Cygwin git because I'm a heavy Cygwin user anyway.

The two treat execute permissions differently. When you checkout a foo.cmd or foo.bat file in the MSYS environment, it treats it as executable because the .cmd or .bat suffix denotes an executable format. Cygwin doesn't; it's a Unix-like environment, so it doesn't assume that a file is executable based on its suffix. So the *.cmd files were working fine for everyone else, but not for me.

The workaround was to do a chmod +x and check in and push the change, which made the files executable for me and didn't affect other users.

I also ran into some problems with entering passwords when doing push, pull, or fetch; the code in git that turns off echoing works under MSYS, but not under Cygwin. I was able to avoid that by using passwordless ssh.

Apart from that (and perhaps one or two other issues that I'm not remembering at the moment), things went reasonably smoothly.

1
  • 1
    thanks for the tips, I installed Cygwin this morning because I wanted a better Command line console, I didnt realize that I could get a wrapper so I have one called Console now that has a tab for Windows Command prompt, windows PowerCMD, and Cygwin. I just installed the msysGit version and was able to add it's console as a tab as well so it looks like I might not really have a need for Cygwin anymore, unless I can find some oher useful reason to keep it around
    – JasonDavis
    Commented Dec 3, 2011 at 23:43
5

Git for cygwin and msysGit install completely separate executables. The former only works within cygwin; the latter installs its own bash shell (and GUI tools) but can also work from cmd.exe or PowerShell. I personally prefer msysGit.

Both will work against the same Git repositories.

3

If by some unlucky twist of fate, you're dealing with a git repository where some commits in its history are say, a few gigs in size, then you will run out of memory with MSysGit, because as of right now, only a 32-bit version is available (there is a 64bit version that is in Pre-apha, but as of right now, it still fails some test and is therefore not suitable for production). Only in this situation does a 64 bit version of Git become a necessity.

UPDATE: There is a way by which you can still use 64bit Git without going the Cygwin route:

  1. Install Vagrant
  2. Install VirtualBox
  3. Add this VagrantFile to an empty folder
  4. Tweak it to your needs
  5. On the command prompt cd to the new folder and
    1. Issue the command "vagrant up". Grab a coffee while this completes.
    2. Next, issue the command "vagrant ssh"

You now have a Linux virtual machine with 64-bit git installed. Next, within the virtual machine:

  1. cd /vagrant
  2. git clone

Let it complete and you will have a 64 bit installation of Git controlling your repository on Windows.

2

You might be confusing git the tool with git repos. msysgit and cygwin git provide the tools, the repositories can exist independently of having git binaries around.

1 - Yes. msysgit is an implementation of git that uses MSYS, and has higher performance than Cygwin git. msysgit has command line git.exe executables as well. msysgit will not depend on other things, and you can run it from regular cmd.

Cygwin's git will have dependencies on the Cygwin system, and is slow compared to msysgit.

You can, however, have both installed, but if you don't use cygwin for anything else, it's not necessary to install it just for git. I strongly favor msysgit here.

2 - git is git, you can use msysgit or cygwin's git for the same repositories, though be careful of version mismatches (like if you're using msysgit 1.7.8 and cygwin git 1.6). I don't think it's a big problem but I've never had multiple git versions installed.

edit:

3 - msysgit portable means you can carry msysgit around on something like a flash drive.

Extra:

You might want to give TortoiseGit a try. It's a GUI for git, and gives you context menus for doing git stuff in the Windows Explorer. You do need to have msysgit installed before installing TortoiseGit.

1
  • +1 for Tortoise git if that's your thing, means you can interact with it through windows explorer, including pretty icons showing file status
    – MattJenko
    Commented Dec 3, 2011 at 23:48
2

By all means do NOT install cygwin's git. It's slow to death. I am about to try msysgit, hoping for a saner performance.

1
  • 1
    I've also noticed that Cygwin's version of Git seems to not have as great performance as the msysgit version. The difference seems to be minor in my experience, like in the range of a few seconds, but when I'm banging out a bunch of Git commands in quick succession, any difference in performance starts to add up.
    – user456814
    Commented Aug 12, 2013 at 4:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.