不支持压缩,Azure git 通过 SSH 推送?

Unsupported compression, Azure git push over SSH?

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

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。如果我将 push URL 更改为 https 而不是 ssh,则工作正常。因此,对于我应该在哪里寻找答案的建议,或者如果您有通过 git cli 将新创建的分支推送到 Azure 存储库的解决方案,我们将不胜感激。

我确实找到了解决方法。您从 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'.

我在为客户将存储库从 gitlab 移动到 vsts 时遇到此错误。 我通过 运行

解决了 SSH 切换到 HTTPS
  1. git gc 在我的克隆中执行垃圾收集
  2. git remote prune origin 清理任何陈旧的分支引用

然后重试 git push vsts --all

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