Git LFS fails with error: failed to push some refs to

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

Pushing attempt with Git LFS results in when cloning, pushing or pulling/fetching, the client may fail like so:

1 2 3 4 $ git push Git LFS: (0 of 1 files) 0 B / 5 MB Git LFS is disabled error: failed to push some refs to 'ssh://git@bitbucket.example.com:7999/~username/myrepo.git'

Cause

Cause #1:

This indicates the repository does not have LFS enabled. A user with REPO_ADMIN permissions is able to enable LFS support.

Cause #2:

When pushing large files through a reverse proxy to Bitbucket server, ngnix has been found guilty of this issue due 2 specific configurations that need to be tweaked for it.

Resolution

Cause #1:

A user with REPO_ADMIN permissions is able to enable LFS support. Please refer to the link below and double check it is enabled:

Cause #2:

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.