Git for Windows is bundled with "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.
The basic idea is that C:\Program Files\Git\mingw64\
is your /
directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git
, the mingw64
in this directory is your root).
If you go to that directory, you will find the typical linux root folder structure (bin
, etc
, lib
and so on).
If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories.
Sometimes the windows binary have funny prefixes, so you should rename the exe file to the standard name.
Since bin
is on the PATH, it will be automatically available to Git Bash.
How to add some programs:
- Download the latest binary for windows from the programs website (they are available as a zip with documentation, or just an exe)
- If you downloaded the zip, extract all (if windows built in zip utility gives an error, use 7-zip).
- Move
*.exe
toC:\Program Files\Git\mingw64\bin\
- Watch command comes from the bundle procps-ng (procps is a set of command line and full-screen utilities).
- Download the zip/tar from, https://gitlab.com/procps-ng/procps.git or https://sourceforge.net/projects/procps-ng/
- If you downloaded the zip, extract all files (use 7-zip).
- Copy the contents to
C:\Program Files\Git\mingw64\
merging the folders, but do NOT overwrite/replace any existing files.
- Other linux/Unix commands can be added to Git Bash in the same manor.
- Find the required command's .exe file from project source.
- Place it in the
C:\Program Files\Git\mingw64\bin
directory - If you want the help/man pages as well then copy the contents to
C:\Program Files\Git\mingw64\
merging the folders, but do NOT overwrite/replace any existing files.
And now you are golden. Happy Hunting!