6

我正在尝试将一个新分支推送到失败的 azure repo。收到不支持压缩方法的错误。尝试用谷歌搜索错误,但我的搜索没有显示任何看起来相同的问题。

PS C:\dev\vh> git push --set-upstream origin upgrade/2019-12-12_Merged-HC_Development_to_hc
Counting objects: 67, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (41/41), done.
remote: The archive entry was compressed using an unsupported compression method.
fatal: The remote end hung up unexpectedly
fatal: sha1 file '<stdout>' write error: Broken pipe
error: remote unpack failed: error The archive entry was compressed using an unsupported compression method.
error: failed to push some refs to 'git@ssh.dev.azure.com:v3/vh/VHT/VHT'

试图找到在 ssh url 上创建此分支的解决方案。如果我将推送 URL 更改为 https 而不是 ssh,则效果很好。因此,非常感谢关于我应该在哪里寻找答案的建议,或者如果您有解决方案通过 git cli 将新创建的分支推送到 Azure 存储库。

4

2 回答 2

12

将存储库从 gitlab 移动到客户端的 vsts 时出现此错误。我设法通过运行来解决它而无需切换SSHHTTPS

  1. git gc在我的克隆中执行垃圾收集
  2. git remote prune origin清理任何过时的分支引用

然后重试git push vsts --all.

vsts指的是我的新 vsts 存储库的远程名称。 origin指向我的 gitlab 存储库。

于 2020-05-20T11:00:12.077 回答
4

我确实找到了解决办法。您从 ssh 更改为 https 的位置。这在我的情况下有效,但感觉不正确,因为我指出要克隆 repo 以作为 SSH 开始(并且可能是您仅使用 SSH 的用例)。

PS C:\dev\vh> git remote -v
origin  git@ssh.dev.azure.com:v3/vh/VHT/VHT (fetch)
origin  git@ssh.dev.azure.com:v3/vh/VHT/VHT (push)

PS C:\dev\vh> git remote set-url --push origin https://vh@dev.azure.com/vh/VHT/_git/VHT
PS C:\dev\vh> git remote -v
origin  git@ssh.dev.azure.com:v3/vh/VHT/VHT (fetch)
origin  https://vh@dev.azure.com/vh/VHT/_git/VHT (push)

如:

PS C:\dev\vh> git push --set-upstream origin upgrade/2019-12-12_Merged-HC_Development_to_hc
Counting objects: 67, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (41/41), done.
Writing objects: 100% (67/67), 1.76 GiB | 2.70 MiB/s, done.
Total 67 (delta 41), reused 28 (delta 23)
remote: Analyzing objects... (67/67) (667290 ms)
remote: Storing packfile... done (24816 ms)
remote: Storing index... done (67 ms)
remote: We noticed you're using an older version of Git. For the best experience, upgrade to a newer version.
To https://dev.azure.com/vh/VHT/_git/VHT
 * [new branch]        upgrade/2019-12-12_Merged-HC_Development_to_hc -> upgrade/2019-12-12_Merged-HC_Development_to_hc
Branch 'upgrade/2019-12-12_Merged-HC_Development_to_hc' set up to track remote branch 'upgrade/2019-12-12_Merged-HC_Development_to_hc' from 'origin'.
于 2019-12-12T12:11:05.473 回答