1

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

リポジトリ ディレクトリに切り替えて、リモート オプションなしで実行すると問題ありません。すなわち

cd /home/user/repos/repodir
git archive --format=tar.gz  --prefix=/tmp/test_archive -o archive.tar.gz ref12345

使用されている --remote 構文に問題がありますか? または --remote オプションがローカル リポジトリでサポートされていませんか?

4

1 に答える 1