What I would like to do is to checkout a single file or a set of files with a common name part like this
git checkout myBranch */myFile.md
and
<
Powershell
@(gci -Recurse *test* | Resolve-Path -Relative) | %{git checkout mybranch -- $_)
gci generates a list of all files matching the criteria (*test*
) then pipes it to Resolve-Path to get the relative path. Finally the flattened (@) list of filenames is piped into the git invokation (executes once per file found).