fabic974 random (binary) wanderings in the philament empires…

Git: remove untracked files onliner

Yet another onliner for cleaning up untracked files from a checked-out Git tree.

$ git status -uall --porcelain \
    | grep -E '^\?\? +'        \
    | awk '{ print $2 }'       \
    | xargs -rt -d\\n rm -v

Or move to the trash instead with gio trash ... :

$ git status -uall --porcelain \
    | grep -E '^\?\? +'        \
    | awk '{ print $2 }'       \
    | xargs -rt -d\\n gio trash

EOF