Paths handled differently by diff and checkout
- From
- Constantin Weißer <i7c@posteo.de>
- Date
- Apr 7, 2016, 20:55 UTC
- Message-ID
- <146006251650.27005.6715475336032533932@localhost.localdomain>
Hi,
say I got a file called "asdf" somewhere in a subdirectory. I can do:
git diff other_branch -- \*asdf
and it will show me the diff *only* of that file (which is the only one that matches), so it works as expected. But if I do on the other hand:
git checkout other_branch -- \*asdf
I get: error: pathspec '*asdf' did not match any file(s) known to git.
which is not what I'm expecting. I figure this is due to the fact that diff does not use parse_pathspec() but handles paths diffently (not sure though)? I'd kind of find it useful to be able to 'git checkout some_branch -- \*.txt' to get all differing text files from another branch for example.
Cheers Constantin