I often do something like git add/checkout/stash -- (find -name "*.extension")
.For example, to revert all text files or all images.
It works fine with add
and checkout
.When using add
, untracked files are added, too.When using checkout
or stash
, untracked files are listed as errors ('<file>' did not match any file(s) known to git
).
When using checkout
, there's at least the workaround to do this:
for file in (find -name "*.extension") git checkout -- $fileend
But when using stash, this would create one new stash per file.
I would expect it to work in a way that git stash tracked-file untracked-file
is the same as git stash tracked-file
.
Is this possible?Or is there a workaround?