10

I am trying to push a new branch to azure repo which fails. Get an error that the compression method isn't supported. Tried googling for the error but my search didn't display anything that looked as the same problem.

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'

Tried to find a solution to create this branch over the ssh url. Works fine if I change my push URL to https instead of ssh. So, suggestions on where I should look for an answer, or if you have the solution to push up a newly created branch to Azure repo through git cli would be much appreciated.

duxck
  • 171
  • 1
  • 8

2 Answers2

19

I got this error while moving a repository from gitlab to vsts for a client. I managed to solve it without switching from SSH to HTTPS by running

  1. git gc to perform a garbage collection in my clone
  2. git remote prune origin to clean up any stale branch references

And then retrying the git push vsts --all.

vsts refers to my remote name for the new vsts repository. origin points to my gitlab repository.

nover
  • 2,259
  • 1
  • 27
  • 27
5

I did find a work around. where you change from ssh to https. This works in my case but doesn't feel correct since I made a point to clone the repo to begin with as SSH (and are probably use cases where you are stuck with SSH only).

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)

Such as:

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'.
duxck
  • 171
  • 1
  • 8
  • Thanks for sharing your solution here, you could [Accept it as an Answer](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) , so it could help other community members who get the same issues, thanks. – Hugh Lin Dec 16 '19 at 01:26
  • I ran into this issue in 2020, and using HTTPS is what works for me with Azure DevOps. The solution by @nover (`gc` and `remote prune`) does help to get beyond the "unsupported compression method" error, but push still fails at `remote: Analyzing objects... ` stage. – sastanin Nov 24 '20 at 12:22
  • `gc` and `remote prune` did not even got me past "unsupported compression method" but using https instead. – Mirco Ellmann Dec 15 '21 at 08:13
  • For me it was the other way around: `https` which I normally use did not work (`remote: The archive entry was compressed using an unsupported compression method.`), switching to `SSH` solved the issue. Neither `gc` nor `remote prune` had any effect. – Pegolon Jul 25 '23 at 04:42