Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub: fatal: protocol error: unexpected capabilities^{} - how to diagnose and remedy?

Tags:

git

github

I have empty private repository on GitHub I can normally access from the web.

When I make attempt to push some history I already did locally, I'm getting:

fatal: protocol error: unexpected capabilities^{}

Googling indicates in the past it meant server doesn't support SHA256, but that was 9 years ago. What could go wrong today?

How to diagnose the problem?

What's the remedy for it?

I'm using git version 2.34.1 from Ubuntu 22.04.


Edit: Following @VonC answer I upgraded git to 2.42.0. And now the message changed to:

fatal: the receiving end does not support this repository's hash algorithm

which absolutely doesn't help how to fix the problem with the local repo. Hashes in the log are 64 characters long.

like image 560
Michał Fita Avatar asked Oct 12 '25 12:10

Michał Fita


1 Answers

The problems seems to be that the error (in new git):

fatal: the receiving end does not support this repository's hash algorithm

is caused by the simple fact GitHub in 2023 still doesn't support repository version format 1 with SHA256 commits (Sadly true about GitLab either).

When I rewrite history by format-patch of each commit and git am them on fresh repository with format version 0 (I had to recreate tags as well), then I managed to push.

Now, how my repository has been created as version 1 originally I don't know/remeber - I think it was bare git init, but maybe it was something else (possibilities are cargo and VSCode).

You have been warned. Hopefully this answer (valid at the day of writing) would help anyone else Googling for this problem.

like image 189
Michał Fita Avatar answered Oct 14 '25 05:10

Michał Fita