Add tree command to Git bash on Windows
If your Git bash on Windows is not shipped with
tree command, you can reinstall it and choose
use Git and optional Unix tools option on install or just add this command manually.
- Reinstall Git for Windows
Download Git for Windows. During the installation, check the option
Use Git and optional Unix tools when you are prompted to setup how to use Git from the command line. This option makes both Git and optional Unix tools to be added to your PATH. Then you can use Git bash like an Unix-style terminal.
- Add tree command manually
Tree for Windows package, then extract the
tree.exe from the package and copy it to the
usr\bin folder under Git installation location like
C:\Program Files\Git\usr\bin. Then your Git bash will be ready to use
tree command. Except putting the
.exe file at a specific folder, an alternative method is adding the location of
tree.exe to the
PATH environment variable.
See make Git bash on Windows better for more utilities that can be added to Git bash.