Without cloning the repository, we need to fetch a raw file from a specific branch of the GIT repository. It is not clear from the docs of git archive how can we fetch a specific file from a specific branch.
How can we do this?
You can use git archive and using the -- to specify a file from the branch.
The command is:
git archive --remote=<repo> <branch> -- <path/to/file> | tar -xO This outputs to STDOUT, you can redirect from there...
--directory flag