Unable to push new commit from shallow clone
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Fisheye および Crucible は除く
問題
When trying to push new commits in a shallow clone to Bitbucket Server, the following error is returned:
fatal: protocol error: expected old/new/ref, got 'shallow <commit hash>'
原因
When pushing commits from the command line from a local repository created from shallow clones, the push fails with the abovementioned protocol error. This functionality was added in Git version 1.9.
ソリューション
Ensure you are running Git 1.9+ on both server and client side.