Use Cygwin or msysGit version of Git, or both?

后端 未结 6 1858
我寻月下人不归
我寻月下人不归 2020-12-24 07:04

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 wha

相关标签:
6条回答
  • 2020-12-24 07:45

    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.

    0 讨论(0)
  • 2020-12-24 07:47

    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.

    0 讨论(0)
  • 2020-12-24 07:54

    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.

    0 讨论(0)
  • 2020-12-24 08:02

    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.

    0 讨论(0)
  • 2020-12-24 08:05

    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.

    0 讨论(0)
  • 2020-12-24 08:09

    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.

    0 讨论(0)
提交回复
热议问题