【发布时间】:2017-04-30 08:23:48
【问题描述】:
我正在尝试从一个远程存储库中获取一个目录,但我只想从特定哈希中获取该文件。如果我将 git archive 与 HEAD 一起使用,一切都很好,但是当我尝试使用特定的哈希时:
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 archive -v --format tar --remote=ssh:.....myrepo.git --exec="/usr/local/bin/git upload-archive" ahash afile > output.tgz
它也没有工作。我认为是因为 BitBucket 不支持 https://confluence.atlassian.com/bitbucketserverkb/git-upload-archive-archiver-died-with-error-779171761.html
所以我想知道:还有其他简单的方法可以做到这一点吗?
【问题讨论】:
标签: git hash bitbucket commit archive