One Liner
git ls-files -v | grep "^[a-z]"
Usar aliases
IMHO, git hidden
é melhor para arquivos marcados como --assume-unchanged
:
git config --global alias.hidden '!git ls-files -v | grep "^[a-z]"'
Aqui está uma lista de aliases relacionados que tenho em ~/.gitconfig
:
[alias]
hide = update-index --assume-unchanged
unhide = update-index --no-assume-unchanged
unhide-all = update-index --really-refresh
hidden = !git ls-files -v | grep \"^[a-z]\"
ignored = !git status -s --ignored | grep \"^!!\"
Para fazê-lo funcionar em subdiretórios e argumentos de suporte :
hidden = "!f(){ git -C \"$GIT_PREFIX\" ls-files -v \"$@\" | grep \"^[a-z]\";}; f"
ignored = "!f(){ git -C \"$GIT_PREFIX\" status -s --ignored \"$@\" | grep \"^!!\";}; f"
Por exemplo:
# cd target
# git ignored classes
Sobre o status do arquivo
Para mim, a maioria dos arquivos ocultos é marcada com sinalizador h
, embora na verdade existam vários outros sinalizadores, de acordo com o manual de git-ls-files
-v
:
-v
Similar to -t, but use lowercase letters for files that are
marked as assume unchanged (see git-update-index(1)).
Sobre git ls-files
-t
:
This option (-t) identifies the file status with the following tags
(followed by a space) at the start of each line:
H cached
S skip-worktree
M unmerged
R removed/deleted
C modified/changed
K to be killed
? other