Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Cygwin or msysGit version of Git, or both?

Tags:

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.

like image 689
JasonDavis Avatar asked Dec 03 '11 22:12

JasonDavis


2 Answers

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.

like image 150
manojlds Avatar answered Oct 12 '22 11:10

manojlds


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.

like image 36
Keith Thompson Avatar answered Oct 12 '22 11:10

Keith Thompson