gitree
is a wrapper utility around tree created by Steve Baker et al. It
reads your .gitignore
and excludes those paths from being listed in the
output of tree
.
If you haven't already, first install Git and Tree. Versions may be available from your package manager (apt-get, homebrew, etc).
Once the dependencies are taken care of, simply copy or link the gitree
script file into your PATH.
# Example: copy the script to /usr/local/bin
cp gitree /usr/local/bin