Let's say we have a git repo somewhere (in reality, this will be a git server that we run). In this repository, we have the file foo.txt, which has been revised a few times. Using LibGit2Sharp, how can we retrieve the latest version of foo.txt (or any specified file) from the server to view?
(Note that this process would be used in a very high-volume application, so efficiency is ideal, and we would like to avoid getting more data from the server than just the file itself).
I've looked at the documentation, and (partly because I'm still not very familiar with git) I can't figure out how this would be done. I know that there is a git unpack-file <blob> command, which looks like it might be what I want. Is there a way to replicate this behavior with LibGit2Sharp?
Furthermore, if we can do this, is there a way to get a specific revision of foo.txt instead of just the last revision?
https://raw.githubusercontent.com/<user>/<repo>/<hash>/path/to/fileorhttps://gitlab.com/<user>/<repo>/raw/<hash>/path/to/file. - Chris