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
bin
folder - Extract
tree.exe
toC:\Program Files\Git\usr\bin
- Try on your git-bash now. Result
bin
folder
tree.exe
to C:\Program Files\Git\usr\bin
For further actions, you may consider blocking this person and/or reporting abuse
Daniel Kraus -
Mirza Saikat Ahmmed -
Pranav Bakare -
Idan -
Top comments (3)
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 -C
adds colour making directories easier to visually separate from files. Usingtree -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.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.
Cheers.