11

I have Git for Windows installed on a Windows 7 machine (no, sadly I can't switch to W10 on this particular machine). This comes with a bash environment that uses MinGW-64 but only includes some binaries. I'd like to add more, such as GCC.

It seems like there should be someway of adding to the MinGW-64 binaries within the git bash instead of adding a whole other MSYS2/MinGW-64 install. However I'm not exactly clear on what is the best way to go about enabling this. I have tried installing win-builds in the bash install usr/ directory (seemed like the place all the other binaries were). It seems to run OK but it doesn't seem to add anything AFAICT, no executables, no folders, nada... except if I try to run the install again it complains that there are already files there... though they patently aren't.

Thus my question is this: can I use win-builds or some other binary to achieve my aim and if so, how?

Note: There are several questions about this around the net and SE, but most are quite old and so no longer relevant AFAICT due to changes in MSYS2, MinGW and Git for Windows.

screenshot showing win-builds complaining that non-existant folders exist

4
  • Ah. I see the following is likely relevant and probably means I should just go install MSYS separately. I'll leave this question open for a while in case someone has alternatives. stackoverflow.com/q/32712133/1292918
    – Toby
    Feb 12, 2018 at 17:43
  • 1
    What’s wrong with replacing Git for Windows entirely?
    – Daniel B
    Feb 14, 2018 at 14:37
  • @DanielB I hadn't considered that TBH. Though I do like to have the GUI there in case something goes drastically wrong. On such occasions I don't like to have to spend time researching arcane command options to get output that is easily visually parsable.
    – Toby
    Feb 14, 2018 at 14:42
  • 1
    You can always use a different GUI like SourceTree oder Git Extensions. Git also ships with gitk, but I don’t know whether that would be available with MSYS.
    – Daniel B
    Feb 14, 2018 at 14:48

3 Answers 3

10

USE MINGW-W64

  1. Install mingw-w64 (Follow the "Sourceforge" link) and install it to the default Program Files based path.

  2. Select the latest "version" (for GCC), change "architecture" from i686 (32-bit) to x86_64 (64-bit), and change "threads" to win32.

  3. Add the bin folder to the beginning of your Git BASH (MINGW64) path:

     $ export PATH="c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin:$PATH"
    

    You'll, of course, need to adjust the above path to match the version of your of your particular install:

     $ export PATH="c:/Program Files/mingw-w64/<YOUR_ARCH_VERSION_REVISION_FOLDER>/mingw64/bin:$PATH"
    

Alternatively

You may be able to just install it directly into the same folder as Git: C:\Program Files\Git.

But I haven't tried this alternative approach and I wouldn't recommend it because it is likely to cause issues when updating and may confuse uninstallers, leaving remnants. (if the two installations don't interfere to begin with)

[ Edit: GNU Make is installed as mingw32-make.exe. You can make a copy of it, somewhere in your $PATH which you have permission to, and rename it to make. Git Bash seems to respect that it's executable, even without an extension, which is handy if you don't want it picked up outside of the MinGW environment (even though it may be in your PATH). ]

0
2

FWIW I just uninstalled Git for Windows and instead installed both GCC and git within MSYS2, as @DanielB commented.

1

You have to share Windows' PATH (and probably other) environment variables with MinGW. For MSYS2 you can share them by adding this to your Windows' env. variables:

MSYS2_PATH_TYPE=inherit

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .