Skip to content

Instantly share code, notes, and snippets.

@carlosame
Last active April 30, 2024 02:16
Show Gist options
  • Save carlosame/5c4070c3941707c0f2c2a5bf1b175cc4 to your computer and use it in GitHub Desktop.
Save carlosame/5c4070c3941707c0f2c2a5bf1b175cc4 to your computer and use it in GitHub Desktop.
Install additional commands on Git Bash (Windows 10)

Install additional commands on Git Bash (Windows 10)

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.

  1. 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.
  2. 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
  1. If you need to extract files from a .zst archive, you'll need to install libzstd first. Then use tar -I zstd, for example:
    tar -I zstd -xvf ../xxhash-0.7.4-1-x86_64.pkg.tar.zst
  1. 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 under bin need to go inside mingw64\bin. You'll need administrator privileges.
  2. Remove the temporary working directory, re-create it to install a new command.

Alternative procedures

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment