Step-by-step
- Go to http://gnuwin32.sourceforge.net/packages/tree.htm
- Download the Binary version (see image below)
- Open the zip file and double click to
binfolder
- Extract
tree.exetoC:\Program Files\Git\usr\bin - Try on your git-bash now.
Result
Top comments (3)
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 treeIn 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.
Cheers.
you can use
no need to install anything
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 -Cadds colour making directories easier to visually separate from files. Usingtree -L 2will 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
/Fswitch.