views:

35

answers:

1

I would like to checkout a single file from a remote git-repository.

Is there a way to checkout a single file from a remote git-repository, without checking out the other commits?

EDIT:

Following the answers, I've realized that i can do a git fetch, and then a git checkout origin/branch path/to/file, which works great.

+2  A: 

This similar question shows a few solutions, including git show and git cat-file.

git show rev:path/to/file

If you want to retrieve the contents into a file, you'll need redirect stdout appropriately.

MikeSep