小编Fer*_*ins的帖子

git 归档来自远程的特定哈希

我正在尝试从一个远程存储库获取一个目录,但我只想从特定的哈希中获取该文件。如果我使用带有 HEAD 的 git archive 一切正常,但是当我尝试使用特定的哈希时:

git archive -v --format tar --remote=ssh://....myrepo.git agitash 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
Run Code Online (Sandbox Code Playgroud)

所以我读到我可以使用另一个上传存档,如下所示:

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 commit bitbucket archive

7
推荐指数
1
解决办法
4325
查看次数

标签 统计

archive ×1

bitbucket ×1

commit ×1

git ×1

hash ×1