Created
November 21, 2020 18:26
-
-
Save theapache64/9492d00abade1a38c781bd061fcc10ae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function git-ls { | |
# tree respecting gitignore | |
local ignored=$(git ls-files -ci --others --directory --exclude-standard) | |
local ignored_filter=$(echo "$ignored" \ | |
| egrep -v "^#.*$|^[[:space:]]*$" \ | |
| sed 's~^/~~' \ | |
| sed 's~/$~~' \ | |
| tr "\\n" "|") | |
tree --prune -I ".git|${ignored_filter: : -1}" "$@" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment