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.
This similar question shows a few solutions, including
git showandgit cat-file.If you want to retrieve the contents into a file, you’ll need redirect
stdoutappropriately.