When I try to run git archive
on a local repository from a different directory
git archive --format=tar.gz --remote=file:///home/user/repos/repodir --prefix=/tmp/test_archive -o archive.tar.gz ref12345
this command fails with the output below. It seems the remote option is not accepted.
remote: fatal: no such ref: ref12345
fatal: sent error to the client: git upload-archive: archiver died with error
remote: git upload-archive: archiver died with error
When I switch to the repo directory and execute without the remote option it is fine. ie
cd /home/user/repos/repodir
git archive --format=tar.gz --prefix=/tmp/test_archive -o archive.tar.gz ref12345
Is there a flaw in the --remote syntax used, or is the --remote option not supported for local repositories?