DEV Community


Posted on • Updated on

Add tree to git-bash on Windows 10


  1. Go to
  2. Download the Binary version (see image below) Alt Text
  3. Open the zip file and double click to bin folder Alt Text
  4. Extract tree.exe to C:\Program Files\Git\usr\bin
  5. Try on your git-bash now. Result image


Top comments (3)

bugb profile image
bugb • Edited

you can use

cmd //c tree
Enter fullscreen mode Exit fullscreen mode

no need to install anything

xixianykus profile image

This works well for a basic listing of sub directories.

However the first method, using the Linux version, has a lot more options. Using tree -C adds colour making directories easier to visually separate from files. Using tree -L 2 will just go down 2 levels (or any number you use).

I couldn't get the Windows version to list out files from git-bash properly either using the /F switch.

fouram profile image
fouram • Edited

Thank you for your post. But I would like to point out that gnuwin32 is a very old project and that there are good alternatives today. Since you can call commands from other CLIs from the GIT Bash, I suggest doing the same. Don't rely on old libraries.

You can use the CMD example already mentioned. My point is that the possibilities are not limited to CMD. You can also use powershell commands in GIT Bash instead. This is far more powerful.

powershell tree

In general i recommend the use of the Microsoft Windows Terminal.

The purpose of GIT Bash is not to emulate a Linux environment, but simply to use GIT. I hope it helps someone.