5 ms·
As a die hard unix fan being forced to work on Windows, git bash is a godsend. Sure now you have WSL and countless other options but git bash is one click away
by skywal_l 5y ago
As a die hard unix fan being forced to work on Windows, git bash is a godsend.
Sure now you have WSL and countless other options but git bash is one click away and works surprisingly well.
- riedel 5y agoI really wonder what make git bash so much more popular than msys2 or cygwin. Ever since switching from Linux/FreeBSD cygwin has lessened the pain of windows a lot.
- leppr 5y agoIt's simple, portable, and you can just execute EXEs from it. Cygwin has a more complex setup and not great compatibility with windows executables, IIRC.
- riedel 5y agoCannot echo this at all. I use native binaries like pandoc or chocolatey from cygwin all the time. The only issue may be with stdout and file paths. There is still msys, if you want more windows. I think git bash mostly is only a packaged msys distribution, isn't it??
- michaelsbradley 5y ago> There is still msys MSYS2 is the better option, and is not "MSYS version 2", it's an independent rewrite. > git bash mostly is only a packaged msys distribution, isn't it? It's in parts based on MSYS2, but doesn't give you a "full install" (or whatever is the best way to phrase it).
- riedel 5y agoSorry for being sloppy I meant msys2.
- michaelsbradley 5y ago> Cygwin has a more complex setup and not great compatibility with windows executables, IIRC. And that's how/why MSYS2 is a nice alternative to Cygwin, especially its environments that use UCRT instead of MSVCRT when considering "compatibility" from the perspective of building and shipping software that doesn't require the user to first install a special environment/runtime. UCRT ships by default on Windows 10.
- riedel 5y agoTotally: if you want to redistribute stuff msys2 makes this much easier. I have both on my system. As a shell environment I like cygwin. With posix compatibility I can compile nearly everything (that does not use libuv). I do not get the narrative of complicated setup for this use case. Download installer and click next a few times: does not seem to be so difficult. The cygwin package installer IMHO is a bit easier to use than pacman.
- pletnes 5y agoOne example issue is that cygwin tries much harder to enforce a «linux / chmod» view of file permissions, which it tries to map onto the underlying windows/ ntfs permissions. This can cause issues like creating files that won’t (easily) be deleted and other yak-shaving-inducing problems.
- otachack 5y agoMy experience with Cygwin back in college (~2008) was that it was obtuse and hard to understand. Granted, I didn't have the knowledge of *nix CLI I have now. But looking back and comparing it to Git Bash experience of today, with a simple installer to run, Git Bash wins in convenience. It does suck in other areas though such as trying to start a Python interpreter session (I fallback to PowerShell for that) Cygwin has probably grown a lot better since but I don't see a reason to try it, personally.
- ChrisSD 5y agoWhat's the Python issue?
- lozenge 5y agoThere's no package manager so there's no way to install things and there's no Python included. You could run your Windows Python but the paths will be wrong (C:\ instead of /c/), etc.
- pletnes 5y agoGit bash will translate /c/ to C:\ so that’s only sometimes true. But it won’t translate //c/ or if you set a certain env var… etc. Having to recall all these rules is one reason I dislike working in git bash on windows.
- jliu70 5y agoThe workaround to running the python interpreter from git bash is to preface python with the command winpty like so `winpty python` Reference: http://willi.am/blog/2016/08/08/docker-for-windows-interactive-sessions-in-mintty-git-bash/ http://willi.am/blog/2016/08/08/docker-for-windows-interacti...
- otachack 5y agoI'll try it out! Thank you.
- gruez 5y ago>I really wonder what make git bash so much more popular than msys2 or cygwin Not sure about cygwin, but I thought git bash was based on msys2?
- pletnes 5y agoIf you google «git download» or «install git», that’s what you get. There’s also no package manager or 3rd party packages to worry about or learn how to use. That’s my gut feel, at least. Git bash is based on some ancient cygwin version. You can see that e.g. the «cygpath» utility is still there. MinGW/Msys forked from cygwin due to some techno-political disagreement that I can’t be bothered to learn more about.
- ur-whale 5y ago> I really wonder what make git bash so much more popular than msys2 or cygwin cygwin is so slow it's basically unusable for most tasks except the simplest ones. especially if you run anything with threads.
- jrm4 5y agoHa, I'm glad you got this. As someone who can use Linux all the time and does, "Windows" just seems sillier and sillier; especially with Proton et al.
- MithrilTuxedo 5y agoThe enterprise bank I work for needs a business justification to spend resources to figure out if there's a business justification for allowing the installation of WSL. I asked in 2019. Bouncing between my personal computers and my Windows work computer, what they've done to make git so slow... it makes me sad. On a brand new developer workstation, the git-prompt invocation in PS1 takes over a second to complete. Developers who never used git before don't like it and I understand why. It's like a scene from Harrison Bergeron, like Git Bash has heavy objects strapped to it to make it at least as slow as everything else.
- agurk 5y agoI was recently in a very similar situation to you and found that the $PATH of my git bash contained a network drive. Removing this for me made it still slow but useable. This also made any programs I was running in it - like vim - useable too.
- michaelsbradley 5y agoIt’s owing to the high number of syscalls not being a big drag on Linux, etc. while causing noticeable slowdowns on top of Windows’ architecture/filesystem... something like that. A Microsoft engineer did a good writeup on it several years ago, if I remember correctly. I’ll try to find a link.
- michaelsbradley 5y agoI think this is what I had in mind: https://github.com/Microsoft/WSL/issues/873#issuecomment-425272829 https://github.com/Microsoft/WSL/issues/873#issuecomment-425...