# Paths handled differently by diff and checkout

1 messages from 2016-04-07 to 2016-04-07. Participants: Constantin Weißer.
Thread: https://gitlist.dev/t/41960

## Constantin Weißer, 2016-04-07 20:55

Subject: Paths handled differently by diff and checkout
Message-ID: <146006251650.27005.6715475336032533932@localhost.localdomain>
URL: https://gitlist.dev/e/146006251650.27005.6715475336032533932%40localhost.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

```
