I want to download a file from a private repo. I want to do this with "git" (not gitlab/github api).
Git provide this way https://git-scm.com/docs/git-archive. You can fetch a file like this
git archive --remote=ssh://host/pathto/repo.git HEAD README.md
However I cannot use ssh. I want to download file using http and a token I have.
I can clone my repo like this:
git clone -b branch http://oauth2:$gitToken@${gitRepo}
but if u make a command like this:
git archive --remote=http://oauth2:$gitToken@${gitRepo} branch filename
You encounter an error:
fatal: operation not supported by protocol
So the question is how we can download a file from a private git repo using a token. (git-archive approach or other (git) way)
Thanks