我想從一個遠程存儲庫獲取一個目錄,但我只想從特定的散列獲取該文件。如果我使用HEAD的git壓縮文件,一切正常,但是當我嘗試使用特定的哈希值時:git歸檔從遠程的特定散列
git archive -v --format tar --remote = ssh://....myrepo.git agithash afile> output.tgz
但是我卻越來越
fatal: sent error to the client: git upload-archive: archiver died with error
remote: fatal: no such ref: 9a9c309
remote: git upload-archive: archiver died with error
所以我讀過,我可以用另一種上傳存檔這樣的:
git的存檔-v --format焦油 - remote = ssh:..... myrepo.git --exec =「/ usr/local/bin/git upload-archive」ahas h afile> output.tgz
它也沒有工作。我認爲是因爲BitBucket不支持它按照https://confluence.atlassian.com/bitbucketserverkb/git-upload-archive-archiver-died-with-error-779171761.html
所以我想知道:是否有另一種簡單的方法來做到這一點?