This assumes that your Git Bash is using MSYS instead of Cygwin (look at the output of uname -o if you are in doubt). If you are using Cygwin, please refer to standard Cygwin procedures.
- Open http://repo.msys2.org/msys/x86_64/ (or one of the mirrors at https://github.com/msys2/MSYS2-packages/blob/master/pacman-mirrors/mirrorlist.msys) and download the commands that you want to add.
- Extract the content of the package that you want to install to a working directory. For example,
mkdir tmp
cd tmp
tar xf ../libzstd-1.4.5-2-x86_64.pkg.tar.xz- If you need to extract files from a
.zstarchive, you'll need to installlibzstdfirst. Then usetar -I zstd, for example:
tar -I zstd -xvf ../xxhash-0.7.4-1-x86_64.pkg.tar.zst- Copy or move the binaries (and other relevant files) to the corresponding subdirectory of the Git MinGW64 tree, generally at
C:\Program Files\Git\mingw64. For example, files underbinneed to go insidemingw64\bin. You'll need administrator privileges. - Remove the temporary working directory, re-create it to install a new command.
There are other ways to get a more complete git-bash environment, see for example:
https://superuser.com/questions/701141/how-to-add-more-commands-to-git-bash