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.
2
Answers
The problems seems to be that the error (in new
git
):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 andgit 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 arecargo
and VSCode).You have been warned. Hopefully this answer (valid at the day of writing) would help anyone else Googling for this problem.
I have seen that error message when using Eclipse/JGit, as I explained in JGit: BundleWriter Error when including Refs.
This patch explains:
Check first if the push was done from Eclipse (which would not use a system Git)
And check if upgrading Git (command-line) is enough.