Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Unable to push changes "Failed to push some refs" EOF error

I am unable to push changes from a branch on a repository that has been working for years, as of 3 days ago. I get the errors below, sometimes with a brief attempt to push LFS content before failing:

Pushing to
error: failed to push some refs to ''
Completed with errors, see above.

I can pull and fetch (From main as well as from LFS only), but cannot push. I have tried the low hanging fruit solutions such as updating SourceTree, my local embedded git, LFS pulls, using the terminal with commands from online search results, etc. I am stumped and would appreciate any leads on solutions. Hoping to avoid having to reclone and lose my recent commits on my local branch, but open to that being necessary.

Is there any way to determine if this is an issue on the bitbucket end vs something messed with refs locally? I have the 100GB LFS upgrade with only 15GB used, so I don't think it's a space issue. Perhaps with the space in the main repo? Thanks for any help, been blocked for days.

1 answer

0 votes
Ben Atlassian Team Jun 30, 2022

G'day Scott,

Sometimes this issue can arise if changes have been made in the remote repository that are not present in your local repository before pushing.

If you are able to pull, yet cannot push - I would suggest rebasing your local with your remote branch before attempting to perform a subsequent push:

git pull --rebase origin main
git push origin main

I can confirm that space is not the issue, the size of your repository is currently at 960.9MB, if you had commits which were greater in size than this limit the error would be different and state that the push is too large.

Please let me know if you are still unable to push after performing the above, there is a chance that your local repository history is messed up - in which case we can work through fixing it.


- Ben (Bitbucket Cloud Support)

Thanks a lot for the response Ben. I have tried your suggestion and unfortunately still receive the same EOF/ref error. My output:


sbrod@MyLaptop MINGW32 /d/Projects/Wearethecaretakers2/wearethecaretakers2 (bugfix/era3_final_fixes)
$ git pull --rebase origin bugfix/era3_final_fixes
* branch bugfix/era3_final_fixes -> FETCH_HEAD
Successfully rebased and updated refs/heads/bugfix/era3_final_fixes.

sbrod@MyLaptop MINGW32 /d/Projects/Wearethecaretakers2/wearethecaretakers2 (bugfix/era3_final_fixes)
$ git push origin bugfix/era3_final_fixes
EOFoading LFS objects: 100% (4/4), 16 MB | 0 B/s
error: failed to push some refs to ''


I also ran these commands from my default branch ("develop"), and received an "everything is up to date" response there, but when I tried to push new changes or merge in the above "era3_final_fixes" branch, I received the same errors on push.

I do believe something has gotten out of sync in my local repository related to LFS, or there are problem files in this repo. I was able to push successfully in another small repository I have that does not use LFS.

I'm still blocked by this issue so I appreciate any further suggestions!

Ben Atlassian Team Jul 03, 2022

Hey Scott,

I agree that if you are able to push changes to your remote repo - but not this particular repository, there appears to be something problematic happening on the local repo.

For this case, I would recommend first backing up any changed files which you had intended to commit.

You have two options essentially to resolve this - one is to simply delete the local repository entirely to start from a fresh slate and then perform a new clone to begin working locally again (copy changed files and push these after the fact).

The other is to attempt to repair your local branches by removing their local copies and syncing them with your remote, then resetting the local head to the current remote commit which is a more complex process that I have detailed below.
NOTE: some_other_branch refers to any other branch than the one you are currently fixing, this is because you can't delete a branch while you're already inside that branch

  1. Perform git branch command to get a list of your local branches in your local repository and copy this list somewhere, you will need to run the commands below for each branch on that list

  2. Now that you have a list of the branches, you can begin fixing their commit history (commands are case sensitive):

    git checkout some_other_branch
    git branch -D branch1
    git checkout -b branch1 origin/branch1
    git pull origin branch1
    git reset --hard origin/branch1
  3. Verify that the local commit history matches the remote by comparing the commit list on your remote repo vs local:

    git log -5
  4. Repeat above steps for all of the local branches and then try to push to the repo once you have finished all of these, you should see the following output which means that the local and remote branches are synced properly:

    > git push --force
    Everything up-to-date

Hope this helps.


- Ben (Bitbucket Cloud Support)

Like ScottBrodie likes this

Thank you Ben. I am in the process of deleting the local repo and recloning. I'll update the thread with the results in the next 1-2 days.

Ben Atlassian Team Jul 04, 2022

Hey Scott,

No worries, let me know how it goes.

Just a note as well, if you require lfs files to be present on your system after performing the clone (the LFS files will still be present remotely, your local will just contain pointers to these files), you can run this command afterward:

git lfs fetch --all


- Ben (Bitbucket Cloud Support)

Suggest an answer

Log in or Sign up to answer
Site Admin

Atlassian Community Events