Unable to push new commit from shallow clone
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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.
*Except Fisheye and Crucible
Problem
When trying to push new commits in a shallow clone to Bitbucket Server, the following error is returned:
1
fatal: protocol error: expected old/new/ref, got 'shallow <commit hash>'
Cause
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.
Resolution
Ensure you are running Git 1.9+ on both server and client side.
Was this helpful?