In this case, you can use git archive's '--remote=<URL>' option, for example:
git archive [email protected]:foo/bar.git --prefix=path/to/ HEAD:path/to/ | tar xvf -
this command will produce a tar or zip archive, so all you need is to pipe the output through tar to get the file content:
git archive --remote=git://git.foo.com/project.git HEAD:path/to/directory filename | tar -x
this command will save a copy of 'filename' from the HEAD of the remote repository in the current directory.
The :path/to/directory part is optional. If excluded, then the fetched file will be saved to <current working dir>/path/to/directory/filename.