I\'m unable to checkout files using wildcards, as described on the git-scm page, from a specific refspec . Describing the issue with an example.
Creating a repository wi
As far as I can tell, when you do git checkout d62e124f -- '*.java'
, git uses the current working tree to expand *.java
, not d62e124f
. As you have just deleted all the files, it matches nothing.
Doing
git restore --source d62e124f '*.java'
works, as git then uses the correct ref to expand the wildcard.
git restore
is only available since 2.23.0, before that you can use:
git ls-files d62e124f '*.java' | xargs git checkout d62e124f