当我尝试git archive
从不同目录在本地存储库上运行时
git archive --format=tar.gz --remote=file:///home/user/repos/repodir --prefix=/tmp/test_archive -o archive.tar.gz ref12345
此命令失败,输出如下。似乎不接受远程选项。
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
当我切换到 repo 目录并在没有远程选项的情况下执行时,它很好。IE
cd /home/user/repos/repodir
git archive --format=tar.gz --prefix=/tmp/test_archive -o archive.tar.gz ref12345
使用的 --remote 语法是否存在缺陷,或者本地存储库不支持 --remote 选项?